mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
contrib/bitset: avoid UB on when copying a bitset
This commit is contained in:
@ -319,7 +319,9 @@ egg_bitset_copy (const EggBitset *self)
|
||||
g_return_val_if_fail (self != NULL, NULL);
|
||||
|
||||
copy = egg_bitset_new_empty ();
|
||||
roaring_bitmap_overwrite (©->roaring, &self->roaring);
|
||||
|
||||
if (!egg_bitset_is_empty (self))
|
||||
roaring_bitmap_overwrite (©->roaring, &self->roaring);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user