Skip to content

Commit e0aeea0

Browse files
committed
C++: Fix qhelp for double-free.
1 parent ba4e3ae commit e0aeea0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cpp/ql/src/Critical/DoubleFree.qhelp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66

77
<overview>
88
<p>
9-
Dereferencing a pointer after it has been deallocated may result in memory corruption which can
10-
lead to security vulnerabilities.
9+
Deallocating memory more than once can lead to a double-free vulnerability. This can be exploited to
10+
corrupt the allocator's internal data structures, which can lead to denial-of-service attacks by crashing
11+
the program, or to security vulnerabilities by allowing an attacker to overwrite arbitrary memory locations.
1112
</p>
1213

13-
<include src="dataFlowWarning.inc.qhelp" />
14-
1514
</overview>
1615
<recommendation>
1716
<p>
1817
Ensure that all execution paths deallocate the allocated memory at most once. If possible, reassign
19-
the pointer to a null value after deallocating it. This will both prevent double-free vulnerabilities, and
20-
increase the likelihood of the operating system raising a runtime error if the pointer is subsequently
21-
dereferenced after being deallocated.
18+
the pointer to a null value after deallocating it. This will prevent double-free vulnerabilities since
19+
most deallocation functions will perform a null-pointer check before attempting to deallocate the memory.
2220
</p>
2321

2422
</recommendation>

0 commit comments

Comments
 (0)