Found by GCC14 -Wanalyzer-null-argument.
When unzip is called with mapped NULL, but *_whole not NULL, *_whole
contains the first part of the input. But we check against mapped to
make sure the MAGIC bytes are there.
This only worked because this code path was never taken, unzip is
currently always called with *_whole being NULL.
* libdwfl/gzip.c (unzip): Set mapped = state.input_buffer
when *whole is not NULL.
Signed-off-by: Mark Wielaard <mark@klomp.org>
else
{
state.input_buffer = *state.whole;
+ mapped = state.input_buffer;
state.input_pos = state.mapped_size = *whole_size;
}
}