C++: Switch the source of use-after-free and double-free to be post-update nodes.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-11-27 10:59:52 +00:00
parent 5bb2144c80
commit 90b06c2046
6 changed files with 139 additions and 116 deletions

View File

@@ -275,12 +275,12 @@ struct MyStruct {
void test_free_struct(MyStruct* s) {
free(s->buf);
char c = s->buf[0]; // BAD [FALSE NEGATIVE]
char c = s->buf[0]; // BAD
}
void test_free_struct2(MyStruct s) {
free(s.buf);
char c = s.buf[0]; // BAD [FALSE NEGATIVE]
char c = s.buf[0]; // BAD
}
void test_free_struct3(MyStruct s) {