From 7e8c59699ac3b39bf1ef2ed219baaf38a10d2a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Tue, 26 Aug 2014 20:12:22 +0200 Subject: [PATCH] Fix confusing if vec_len is bytes or number of elements --- src/bitvec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bitvec.c b/src/bitvec.c index edb6cc3..8286d36 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -1,4 +1,5 @@ #include +#include #include #include #include "ucore/bitvec.h" @@ -68,6 +69,7 @@ void uc_bv_set_bits_from_array(struct UCBitVec *v,char *array,size_t array_len) for (i = 0; i < array_len; i++) { size_t idx = (size_t)bit_index(array_len); + if (unlikely(idx >= v->vec_len)) break;