Skip to content

Commit 5382ef7

Browse files
committed
C++: Split the overview section of qhelp into a couple of paragraphs.
1 parent f842d09 commit 5382ef7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToStrncat.qhelp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
<qhelp>
55
<overview>
66
<p>The standard library function <code>strncat</code> appends a source string to a target string.
7-
The third argument defines the maximum number of characters to append and should be less than or equal to the remaining space in the destination buffer.
8-
Calls of the form <code>strncat(dest, src, strlen(dest))</code> or <code>strncat(dest, src, sizeof(dest))</code> set the third argument to the entire size of the destination buffer.
9-
Executing a call of this type may cause a buffer overflow unless the buffer is known to be empty.
10-
Similarly, calls of the form <code>strncat(dest, src, sizeof (dest) - strlen (dest))</code> allow one byte to be written ouside the `dest` buffer.
11-
Buffer overflows can lead to anything from a segmentation fault to a security vulnerability.</p>
7+
The third argument defines the maximum number of characters to append and should be less than or equal
8+
to the remaining space in the destination buffer.</p>
9+
10+
<p>Calls of the form <code>strncat(dest, src, strlen(dest))</code> or <code>strncat(dest, src, sizeof(dest))</code> set
11+
the third argument to the entire size of the destination buffer.
12+
Executing a call of this type may cause a buffer overflow unless the buffer is known to be empty.</p>
13+
14+
<p>Similarly, calls of the form <code>strncat(dest, src, sizeof (dest) - strlen (dest))</code> allow one
15+
byte to be written ouside the <code>dest</code> buffer.</p>
16+
17+
<p>Buffer overflows can lead to anything from a segmentation fault to a security vulnerability.</p>
1218

1319
</overview>
1420
<recommendation>

0 commit comments

Comments
 (0)