Skip to content

C++: New Query: missing return-value check for scanf-like functions #10163

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

Merged
merged 21 commits into from
Sep 1, 2022
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
94c43c0
Update .gitignore for .vscode/*.log temporaries
d10c Aug 11, 2022
76ef779
C++: Add test and placeholder query.
geoffw0 Jul 28, 2022
c62ae3b
C++: First working. We now prefer flagging the cases where the variab…
geoffw0 Jul 28, 2022
69911d4
.clang-format: do not autoformat test.cpp
d10c Aug 17, 2022
ca162a4
C++: complete initial implementation of `cpp/missing-check-scanf`
d10c Aug 11, 2022
170d12b
Write MissingCheckScanf.qhelp
d10c Aug 24, 2022
6158ee1
Change note
d10c Aug 24, 2022
5c894ae
Merge branch 'main' into missing-check-scanf-squashed
d10c Aug 24, 2022
d8800c0
C++: new helper predicates in ScanfFunctionCall
d10c Aug 25, 2022
e39229d
C++: Remove unique-Instruction kludge in ScanfOutput
d10c Aug 25, 2022
a6a30b3
C++: clarify ScanfOutput.getMinimumGuardConstant()
d10c Aug 25, 2022
ad56274
C++: Small improvements to query qldoc and message
d10c Aug 25, 2022
2bd866c
C++: improve change note and move to right place
d10c Aug 25, 2022
02772ed
Revert changes to .gitignore and .clang-format
d10c Aug 25, 2022
7d24d96
C++: Optimize MissingCheckScanf/bigStep()
d10c Aug 25, 2022
e10042b
C++: Improve docs based on doc-review
d10c Aug 30, 2022
ce1e4ad
Merge branch 'main' into missing-check-scanf-squashed
d10c Aug 30, 2022
0729e42
C++: Update metadata based on cwe-scores
d10c Aug 31, 2022
38f185b
C++: Correct CWE tags in metadata
d10c Aug 31, 2022
f5a30c7
C++: Add correctness tag
d10c Aug 31, 2022
f956999
Merge branch 'main' into missing-check-scanf-squashed
d10c Sep 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cpp/ql/src/Critical/MissingCheckScanf.ql
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* @description Failing to check that a call to 'scanf' actually writes to an
* output variable can lead to unexpected behavior at reading time.
* @kind problem
* @problem.severity recommendation
* @security-severity 4.5
* @problem.severity warning
* @security-severity 7.5
* @precision medium
* @id cpp/missing-check-scanf
* @tags security
* @tags security cwe-252 cwe-253
*/

import cpp
Expand Down