OSDN Git Service

hbitmap: add 'pos < size' asserts
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 14 Jun 2016 17:08:12 +0000 (20:08 +0300)
committerMax Reitz <mreitz@redhat.com>
Thu, 16 Jun 2016 13:20:37 +0000 (15:20 +0200)
commit0e321191224c8cd137eef41da3257e096965c3d6
tree0f9d28aba34318ee06c89a7ee1f4d54a8cc9f1ed
parent3dd48fdc55613c102f2811c63ceefd9aebcd44ca
hbitmap: add 'pos < size' asserts

For now, fail in hbitmap_set on start + count > size will come from
hbitmap_set
  hb_count_between
    hbitmap_iter_init
      assert(pos < hb->size)

This patch adds such checks to set/get/reset functions of hbitmap.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 1465924093-76875-2-git-send-email-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
util/hbitmap.c