Created
April 26, 2017 11:56
-
-
Save regit/d9a186f6ce57b4c669644c3ca05dca32 to your computer and use it in GitHub Desktop.
Checking memset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@malloced@ | |
expression x; | |
position p1; | |
identifier func =~ "(calloc|malloc)"; | |
@@ | |
x@p1 = func(...) | |
@memset depends on malloced exists@ | |
expression x; | |
position p2; | |
@@ | |
memset(&x, ...)@p2 | |
@script:python depends on memset@ | |
p1 << memset.p2; | |
@@ | |
print "Memset on address of pointer at %s:%s." % (p1[0].file, p1[0].line) | |
import sys | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To test code, you need to run