mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Reverse order of tests in png_zlib_compress_validate
Undefined behaviour sanitizer currently fires for this test with an error about member access within null pointer to struct; put the check that relies on pz->list being non-NULL second.
This commit is contained in:
parent
1bfeb46881
commit
28fa0d23c1
@ -482,10 +482,10 @@ png_zlib_compress_validate(png_zlib_compressp pz, int in_use)
|
||||
|
||||
if (pz->overflow == 0U && pz->len == 0U && pz->start == 0U) /* empty */
|
||||
{
|
||||
affirm((pz->end == &pz->list->next && pz->zs.next_out == pz->list->output
|
||||
&& pz->zs.avail_out == o_size) ||
|
||||
(pz->end == &pz->list && pz->zs.next_out == NULL
|
||||
&& pz->zs.avail_out == 0U));
|
||||
affirm((pz->end == &pz->list && pz->zs.next_out == NULL
|
||||
&& pz->zs.avail_out == 0U) ||
|
||||
(pz->end == &pz->list->next && pz->zs.next_out == pz->list->output
|
||||
&& pz->zs.avail_out == o_size));
|
||||
}
|
||||
|
||||
else /* not empty */
|
||||
|
Loading…
x
Reference in New Issue
Block a user