I’m coming from the Java area and I’m used that SonarQube is mostly correct with such kind of findings. Now I’m confronted with a small c/c++ project where SonarQube flags code that was originally found in the net as Memory copy function overflows destination buffer I can not not see the point - can you see who is right? I hope it is not all to obvious?
Hello @Andreas_Mandel and welcome to the Sonarsource community!
We are glad you appreciate our products for C and C++.
As for your problem, it seems like a real false-positive. Thank you for reporting.
For now, it seems related to the issue in this ticket.
To speed up further investigations, would you mind generating a reproducer and sending it back to us?Steps are as follow:
Add the reproducer option to the scanner configuration:
sonar.cfamily.reproducer= “Full path to the .cpp file that has or include the file that has the false-positive”
Re-unning the scanner should generate a file named sonar-cfamily.reproducer in the project folder.
Please share this file. if you think this file contains private information we can send it privately.
thanks for looking into this. I’ve added the requested options to the scanner call. Since all is OSS there should be no private data included. sonar-cfamily.zip (685.2 KB)