From 230bddf30ede8110049b149c844ffad34d140498 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 7 Jan 2010 14:42:46 -0600 Subject: [PATCH] Fix: Be paranoid and check that last is in range --- src/idmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/idmap.c b/src/idmap.c index da7f175..cc9a4ff 100644 --- a/src/idmap.c +++ b/src/idmap.c @@ -176,6 +176,9 @@ unsigned int idmap_alloc_next(struct idmap *idmap, unsigned int last) unsigned int bit; unsigned int offset; + if (last < idmap->min || last > idmap->max) + return idmap->max + 1; + bit = find_next_zero_bit(idmap->bits, idmap->size, last - idmap->min + 1); -- 2.7.4