File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 6
6
7
7
<overview >
8
8
<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.
11
12
</p >
12
13
13
- <include src =" dataFlowWarning.inc.qhelp" />
14
-
15
14
</overview >
16
15
<recommendation >
17
16
<p >
18
17
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.
22
20
</p >
23
21
24
22
</recommendation >
You can’t perform that action at this time.
0 commit comments