Pull request means to duplicate git repository. I can do this, but for this minor change it is not neccessary to have right to push backwards. You know better what to do with my report ;).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
size = vsprintf(NULL, format, paramList);
is not NULL dereference but standard way how to get final string size.
Last edit: Jaroslav Fojtik 2019-11-10
Look at here: http://libslack.org/manpages/snprintf.3.html
I guess we need to update the configuration.. could you review it?
Where to find configuration? I did not develop cppcheck yet.
The configuration is fine as far as I see:
https://github.com/danmar/cppcheck/blob/master/cfg/std.cfg#L5923
I can't reproduce the FP. Which version do you use?
I am using the latest one 1.89.
There are two functions vsnprintf and vsprintf. May be that one of them is not defined same way and requires not NULL argument.
Whole source code is attached.
The error is still reported on the line:
size = vsprintf(NULL, format, paramList);
And the header file:
Last edit: Jaroslav Fojtik 2019-11-10
Please note when your system supports vsprintf only, it is much more neccessary to call with NULL first to check space to allocate.
<function name="vsprintf,std::vsprintf">
<returnvalue type="int">
<noreturn>false</noreturn>
<leak-ignore>
<arg nr="1" direction="out">
<not-null></not-null> <<<<<!!!!!!!
</arg>
<arg nr="2" direction="in">
<not-null>
<not-uninit>
<formatstr>
</formatstr></not-uninit></not-null></arg>
<arg nr="3">
</arg></leak-ignore></returnvalue></function>
Last edit: Jaroslav Fojtik 2019-11-10
Do you want to send a github pull request? I would suggest that we replace
<not-null/>
with<not-uninit/>
.Pull request means to duplicate git repository. I can do this, but for this minor change it is not neccessary to have right to push backwards. You know better what to do with my report ;).
ok.. I fix it myself..