mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
hbitmap: add assertion on hbitmap_iter_init
hbitmap_iter_init causes an out-of-bounds access when the "first" argument is or greater than or equal to the size of the bitmap. Forbid this with an assertion, and remove the failing testcase. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
88ff0e48ee
commit
1b09524455
3 changed files with 6 additions and 11 deletions
|
@ -128,7 +128,8 @@ void hbitmap_free(HBitmap *hb);
|
|||
* hbitmap_iter_init:
|
||||
* @hbi: HBitmapIter to initialize.
|
||||
* @hb: HBitmap to iterate on.
|
||||
* @first: First bit to visit (0-based).
|
||||
* @first: First bit to visit (0-based, must be strictly less than the
|
||||
* size of the bitmap).
|
||||
*
|
||||
* Set up @hbi to iterate on the HBitmap @hb. hbitmap_iter_next will return
|
||||
* the lowest-numbered bit that is set in @hb, starting at @first.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue