Message275579
>>> "&mp->ma_keys->dk_indices.as_1[mp->ma_keys->dk_size * ((mp->ma_keys->dk_size <= 255L) ? 1UL : ((mp->ma_keys->dk_size <= 65535L) ? 2UL : ((mp->ma_keys->dk_size <= 4294967295L) ? 4UL : 8UL)))]" evaluates to an address that is at byte offset 255 of an array of 8 bytes.
Oh. That's why dictobject.c uses a trick. The C structure uses a fixed buffer of 8 bytes, but the actual allocated memory block has the right size. All these warnings are false positive, don't worry :-)
We might use C99 "buffer[]" syntax, remove dk_indices from the structure, ignore the false alarm, or write a Coverity model for this one. Right now, I would prefer to not touch the C code just for a false alarm ;-) |
|
Date |
User |
Action |
Args |
2016-09-10 06:39:33 | vstinner | set | recipients:
+ vstinner, christian.heimes, methane, xiang.zhang |
2016-09-10 06:39:33 | vstinner | set | messageid: <1473489573.8.0.744238300858.issue28042@psf.upfronthosting.co.za> |
2016-09-10 06:39:33 | vstinner | link | issue28042 messages |
2016-09-10 06:39:33 | vstinner | create | |
|