From 6217804ed59a21ae232a09837e44661bbc1fb15c Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 7 Jun 2015 12:07:24 +0100 Subject: [PATCH] fix another UB in bit_vector Signed-off-by: Nuno Lopes --- src/util/bit_vector.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/bit_vector.h b/src/util/bit_vector.h index e874d8a3d..f3fd7c27b 100644 --- a/src/util/bit_vector.h +++ b/src/util/bit_vector.h @@ -94,7 +94,8 @@ public: } void reset() { - memset(m_data, 0, m_capacity * sizeof(unsigned)); + if (m_data) + memset(m_data, 0, m_capacity * sizeof(unsigned)); m_num_bits = 0; }