$ cppcheck --bug-hunting t.c
Checking t.c ...
t.c:5:8: error: Buffer read/write, when calling 'memset' it cannot be determined that 1st argument is not overflowed [bughuntingBufferOverflow]
memset(&buf, 0, sizeof(buf));
IMHO, the code is right, the checker is wrong. Am I wrong with this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there any progress? This problem bothered me very much.... Maybe you could point out where and how to fix it, I could fire a PR if I could fix it by myself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sorry for late reply. no there was no progress yet. I need to dig in a little to even see where the problem is.. but spontanously it should be something in exprengine.cpp .. maybe in the function executeFunctionCall.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Small test code:
checker yield:
IMHO, the code is right, the checker is wrong. Am I wrong with this?
Yes I agree the code looks safe.
I have created ticket https://trac.cppcheck.net/ticket/10402
Is there any progress? This problem bothered me very much.... Maybe you could point out where and how to fix it, I could fire a PR if I could fix it by myself.
sorry for late reply. no there was no progress yet. I need to dig in a little to even see where the problem is.. but spontanously it should be something in exprengine.cpp .. maybe in the function executeFunctionCall.