Closed jessicah closed 4 years ago
Thanks for digging into this. It sounds quite likely that our query is picking up GNU dprintf too and is having trouble distinguishing between the two.
We're already tracking this bug under #1971.
Ah, I didn't realise he'd filed a ticket, his thinking behind the __func__
macro was a good guess, but invalid :)
This issue should be fixed by https://github.com/Semmle/ql/pull/1987 (please allow approximately 2 weeks for the fix to reach LGTM).
Description of the false positive It appears there is an issue with figuring out the position of the format string with Haiku's kernel-only
dprintf
function.URL to the alert on the project page on LGTM.com https://lgtm.com/projects/g/haiku/haiku/snapshot/d26be28c9c1882a2fe59ca80fbcf9410053b590f/files/src/add-ons/kernel/bus_managers/acpi/ACPICAHaiku.cpp?sort=name&dir=ASC&mode=heatmap#xf27d4d8483491c15:1
https://lgtm.com/projects/g/haiku/haiku/snapshot/d26be28c9c1882a2fe59ca80fbcf9410053b590f/files/headers/private/file_systems/QueryParser.h?sort=name&dir=ASC&mode=heatmap#x37242992c01d5a0a:1
I've been experimenting with the query, and with the following changes, I'm seeing two results per
dprintf
call, one with the format string at index 0 (correct), one with the format string at index 1 (incorrect, seems a glibc GNU extension). Is it possible that it's picking up two conflicting definitions ofdprintf
? Shouldn't the shadowed definition be excluded?