Closed 0xceed closed 3 years ago
Also, lib version is 3.2.1
Hi @0xceed, I've checked the code and your screenshot, and found that the static analysis tool is wrong.
The static analysis tool assumes that total_space
could be < ds->append_data_size
. However, it is impossible. When ds->append_data_size > 500
, we not only set ds->append_data
to NULL
, but also set ds->append_data_size
to 0
. Therefore, total_space
should always be >= ds->append_data_size
.
if (ds->append_data_size > 500) {
xfree(ds->append_data);
ds->append_data = NULL;
ds->append_data_size = 0;
}
You may need to use some mechanism to skip this logic error in the static analysis tool. Thanks.
Thank you a bunch, sure thing, I haven't checked it's correctness; just wondered if this real bug.
File:
arg_dstr.c
Line: 307.See screenshot attached. Haven't checked if any other static analyser catches this, but still.