Michael Stefaniuc mstefani@redhat.com writes:
Ok, as there are no false positives i have improved the script a little; documented it on my Smatch page and added it to my daily Smatch run. If you know more functions that return a file_handle i can search for those too. At the moment i'm looking only for the regexp "CreateFile[AW]?".
Probably at least CreateNamedPipe, CreateMailslot and FindFirstFile would be interesting to check.
The opposite check would be nice too, there are probably cases where a call that returns a NULL handle on error is tested against INVALID_HANDLE_VALUE.