Message194518
According to this comment, ssb.values can be null:
/* A sortslice contains a pointer to an array of keys and a pointer to
* an array of corresponding values. In other words, keys[i]
* corresponds with values[i]. If values == NULL, then the keys are
* also the values.
*
* Several convenience routines are provided here, so that keys and
* values are always moved in sync.
*/ <http://hg.python.org/cpython/file/tip/Objects/listobject.c#l969>
However, is ssb.values is null, dest.values must be null as well and sortslice_copy_decr() will not dereference either of the pointers.
Looks like a false positive to me, but I wonder if a strategically placed assert will silence coverity:
Py_LOCAL_INLINE(void)
sortslice_copy_decr(sortslice *dst, sortslice *src)
{
*dst->keys-- = *src->keys--;
if (dst->values != NULL) {
assert(src->values != NULL);
*dst->values-- = *src->values--;
}
} |
|
Date |
User |
Action |
Args |
2013-08-05 22:59:51 | belopolsky | set | recipients:
+ belopolsky, tim.peters, vstinner, christian.heimes |
2013-08-05 22:59:51 | belopolsky | set | messageid: <1375743591.37.0.259196624197.issue18579@psf.upfronthosting.co.za> |
2013-08-05 22:59:51 | belopolsky | link | issue18579 messages |
2013-08-05 22:59:51 | belopolsky | create | |
|