Skip to content

coverity: incorrect model of `stgMallocBytes` and `stgReallocBytes`

The Coverity 'model' of stgMallocBytes (in utils/coverity/model.c) is incorrect: it claims the function never returns NULL (assert(mem != NULL)), which (in its current implementation) is not true (cfr. #22380). Hence, the static analysis could make incorrect assumptions and miss certain bugs.

Similarly, the model of stgReallocBytes seems incorrect, as in, it claims to free p and return NULL when n equals 0, which is correct for Glibc's realloc (though non-standard), whilst the actual implementation would bail out in such scenario (realloc can indeed return NULL, but stgReallocBytes doesn't like that, in any scenario).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information