Skip to content

Commit aac0298

Browse files
authored
C++: doc fixes to VeryLikelyOverrunWrite
1 parent c8741f6 commit aac0298

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cpp/ql/src/Security/CWE/CWE-120/UnboundedWrite.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import TaintedWithPath
3333
* hasExplicitLimit() exists(getMaxData()) exists(getBufferSize(bw.getDest(), _))) handled by
3434
* NO NO either UnboundedWrite.ql isUnboundedWrite()
3535
* NO YES NO UnboundedWrite.ql isMaybeUnboundedWrite()
36-
* NO YES YES OverrunWrite.ql, OverrunWriteFloat.ql
36+
* NO YES YES VeryLikelyOverrunWrite.ql, OverrunWrite.ql, OverrunWriteFloat.ql
3737
* YES either YES BadlyBoundedWrite.ql
3838
* YES either NO (assumed OK)
3939
*/

cpp/ql/src/Security/CWE/CWE-120/VeryLikelyOverrunWrite.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
</recommendation>
1313
<example>
14-
<sample src="OverrunWrite.c" />
14+
<sample src="VeryLikelyOverrunWrite.c" />
1515

1616
<p>In this example, the call to <code>sprintf</code> writes a message of 14 characters (including the terminating null) plus the length of the string conversion of `userId` into a buffer with space for just 17 characters. While `userId` is checked to occupy no more than 4 characters when converted, there is no space in the buffer for the terminating null character if `userId >= 1000`. In this case, the null character overflows the buffer resulting in undefined behavior.</p>
1717

0 commit comments

Comments
 (0)