From 7abc1733c58f8f9861bc9fe49a3700463edb817a Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 19 Jun 2014 12:14:48 +0200 Subject: [PATCH] util: abort construction of zero-sized bit arrays --- repos/base/include/util/bit_array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/base/include/util/bit_array.h b/repos/base/include/util/bit_array.h index 71599fa6ae..e0a0f5f77d 100644 --- a/repos/base/include/util/bit_array.h +++ b/repos/base/include/util/bit_array.h @@ -97,7 +97,7 @@ namespace Genode { _word_cnt(_bit_cnt / _BITS_PER_WORD), _words(addr) { - if (bits % _BITS_PER_WORD) throw Invalid_bit_count(); + if (!bits || bits % _BITS_PER_WORD) throw Invalid_bit_count(); memset(_words, 0, sizeof(addr_t)*_word_cnt); }