This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, christian.heimes, tim.peters, vstinner
Date 2013-08-05.22:59:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375743591.37.0.259196624197.issue18579@psf.upfronthosting.co.za>
In-reply-to
Content
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--;
    }
}
History
Date User Action Args
2013-08-05 22:59:51belopolskysetrecipients: + belopolsky, tim.peters, vstinner, christian.heimes
2013-08-05 22:59:51belopolskysetmessageid: <1375743591.37.0.259196624197.issue18579@psf.upfronthosting.co.za>
2013-08-05 22:59:51belopolskylinkissue18579 messages
2013-08-05 22:59:51belopolskycreate