github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.48k stars 1.49k forks source link

LGTM.com - false positive #8776

Open russell-taylor opened 2 years ago

russell-taylor commented 2 years ago

Description of the false positive

This report is using the size of an array of character pointers (13 * 8) as if it were the size of the array element that is being pointed to (512 bytes). The pointer has been dereferenced to get the pointer to fill in.

URL to the alert on the project page on LGTM.com

https://lgtm.com/projects/g/vrpn/vrpn/snapshot/f75cb88eb7cebaccd487af2d95471a8fa883ffed/files/server_src/vrpn_Generic_server_object.C?sort=name&dir=ASC&mode=heatmap#x4380b89c736eb93a:1

aeisenberg commented 2 years ago

Thanks for reporting this. It does appear to be a false positive result and related to buffer overflows, which is a potential security violation. I am forwarding this on to the team maintaining our C/C++ extractor.

jketema commented 2 years ago

Hi @russell-taylor

Thanks a lot for the report! We are able to reproduce this, and indeed it seems a pointer dereference is being ignored.

We briefly thought there was a simple way to fix this, but unfortunately there isn't. I've created an internal ticket to track this further.

russell-taylor commented 2 years ago

Thank you for making this great service available and for making it so easy to submit specific issues!