Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp/non-constant-format bug #27

Open
1 task
bdrodes opened this issue Nov 3, 2023 · 3 comments
Open
1 task

cpp/non-constant-format bug #27

bdrodes opened this issue Nov 3, 2023 · 3 comments
Labels
question Further information is requested

Comments

@bdrodes
Copy link

bdrodes commented Nov 3, 2023

strings of the form L"..." are being marked as non-constant in cpp/non-constant-format-bug

In discussions with GitHub on a permanent fix they suggested an incremental fix approach:

@bdrodes bdrodes added the question Further information is requested label Nov 3, 2023
@bdrodes
Copy link
Author

bdrodes commented Nov 3, 2023

A deeper dive indicates the reported false positive for this is calling a macro that likely has string copy semantics into a arg of wprtinf, and that copy is not defined.

@bdrodes
Copy link
Author

bdrodes commented Nov 3, 2023

The library in question are all strsafe operations from win32's api: https://learn.microsoft.com/en-us/windows/win32/api/strsafe/

These need to be modeled to fix the bug.

@bdrodes
Copy link
Author

bdrodes commented Nov 8, 2023

I created this branch as a PR POC to github: https://github.com/microsoft/codeql/tree/27-cppnon-constant-format-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant