Skip to content

Commit e10042b

Browse files
committed
C++: Improve docs based on doc-review
Thanks to @mchammer01 and @geoffw0 for the suggestions latest.
1 parent 7d24d96 commit e10042b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cpp/ql/src/Critical/MissingCheckScanf.qhelp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ improper return-value checking.
1212
<p>
1313
Specifically, the query flags uses of variables that may have been modified by
1414
<tt>scanf</tt> and subsequently are used without being guarded by a correct
15-
return-value check. A proper check is one that asserts the corresponding
16-
<tt>scanf</tt> to have returned (at least) a certain minimum constant.
15+
return-value check. A proper check is one that ensures that the corresponding
16+
<tt>scanf</tt> has returned (at least) a certain minimum constant.
1717
</p>
1818
<p>
1919
Functions in the <tt>scanf</tt> family return either EOF (a negative value)
@@ -24,7 +24,7 @@ is not enough.
2424
<warning>
2525
This query has medium precision because, in the current implementation, it
2626
takes a strict stance on unguarded uses of output variables, and flags them
27-
as problematic even if they had already been initialized.
27+
as problematic even if they have already been initialized.
2828
</warning>
2929
</overview>
3030

@@ -46,6 +46,6 @@ input. This can be done by comparing the return value to a numerical constant.
4646
<references>
4747
<li>SEI CERT C++ Coding Standard: <a href="https://wiki.sei.cmu.edu/confluence/display/cplusplus/ERR62-CPP.+Detect+errors+when+converting+a+string+to+a+number">ERR62-CPP. Detect errors when converting a string to a number</a>.</li>
4848
<li>SEI CERT C Coding Standard: <a href="https://wiki.sei.cmu.edu/confluence/display/c/ERR33-C.+Detect+and+handle+standard+library+errors">ERR33-C. Detect and handle standard library errors</a>.</li>
49-
<li>cppreference.com: <a href="https://en.cppreference.com/w/c/io/fscanf">scanf, fscanf, sscanf, scanf_s, fscanf_s, sscanf_s</a></li>
49+
<li>cppreference.com: <a href="https://en.cppreference.com/w/c/io/fscanf">scanf, fscanf, sscanf, scanf_s, fscanf_s, sscanf_s</a>.</li>
5050
</references>
5151
</qhelp>

cpp/ql/src/Critical/MissingCheckScanf.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @name Missing return-value check for a 'scanf'-like function
3-
* @description Without checking that a call to 'scanf' actually wrote to an
4-
* output variable, reading from it can lead to unexpected behavior.
3+
* @description Failing to check that a call to 'scanf' actually writes to an
4+
* output variable can lead to unexpected behavior at reading time.
55
* @kind problem
66
* @problem.severity recommendation
77
* @security-severity 4.5

0 commit comments

Comments
 (0)