January 2020
Intermediate to advanced
454 pages
11h 25m
English
As a final example, let's look at the following:
int main(void){ int *p = (int *)42; delete p;}
This results in the following:

In the preceding example, we create an integer to a pointer and then provide it with a corrupt value again. Unlike our previous example, in this example, we attempt to delete the corrupt pointer, which results in a segmentation fault. Once again, ASAN is able to detect this issue, but doesn't have any useful information as an allocation never occurred.
It should be noted that the C++ Core Guidelines—which is a coding standard for modern C++—are incredibly helpful at preventing ...
Read now
Unlock full access