which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube - Developer Edition - Version 9.1 (build 47736)
build-wrapper-win-x86
sonar-scanner-4.7.0.2747-windows
what are you trying to achieve
Detect the out of bound memory access in following code
both line9 and line12 are issues
what have you tried so far to achieve this
Line7, change sizeof(buf) to 8, Sonarqube is able to catch line9 issue, why?
Hi Colin,
Thanks for your reply, I just upgrade my sonarqube version to v9.6.1 but seems like the issue is still there
Developer Edition
Version 9.6.1 (build 59531)
Not able to catch the overflow bug, attach sample code
This kind of failure is the major purpose we buy the license to scan our production code, need help, thanks!
This rule is based on symbolic-execution, i.e. it tries to reason about the state of the program to detect bugs. Unfortunately this technology is not perfect and we can miss some cases, like yours.
However, we always try to improve our engine so thank you for reporting these two false-negatives!
We should be able to fix the second one (l.12). Here is the ticket to follow the progress: CPP-2403.
The other case needs more investigation so I have created a separated ticket to handle it: CPP-3866.