about summary refs log tree commit diff
path: root/instrumentation
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-06-12 10:03:15 +0300
committerGitHub <noreply@github.com>2023-06-12 10:03:15 +0300
commitaf8c68a774d0271ae6a2145ac566e1c7024e95d5 (patch)
treed307651ffd5ad2b03d3e97a2b2ccd4d410e16c93 /instrumentation
parent26cbc1e99337da4dc82c7c827dc2dac0a3733dc2 (diff)
parentbf2727b76366ce4c9cdc723c3f3ccffae3cc3619 (diff)
downloadafl++-af8c68a774d0271ae6a2145ac566e1c7024e95d5.tar.gz
Merge pull request #1766 from AFLplusplus/dev 4.07c
v4.07c release
Diffstat (limited to 'instrumentation')
-rw-r--r--instrumentation/afl-gcc-cmptrs-pass.so.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/instrumentation/afl-gcc-cmptrs-pass.so.cc b/instrumentation/afl-gcc-cmptrs-pass.so.cc
index dbb408b0..c56263dd 100644
--- a/instrumentation/afl-gcc-cmptrs-pass.so.cc
+++ b/instrumentation/afl-gcc-cmptrs-pass.so.cc
@@ -157,6 +157,9 @@ struct afl_cmptrs_pass : afl_base_pass {
     /* We expect it to be a record type.  */
     if (TREE_CODE(t) != RECORD_TYPE) return false;
 
+    /* The type has an identifier.  */
+    if (!TYPE_IDENTIFIER(t)) return false;
+
     /* The type of the template is basic_string.  */
     if (strcmp(IDENTIFIER_POINTER(TYPE_IDENTIFIER(t)), "basic_string") != 0)
       return false;
@@ -201,7 +204,7 @@ struct afl_cmptrs_pass : afl_base_pass {
     /* Now go back to the first data member.  Its type should be a
        record type named _Alloc_hider.  */
     c = TREE_TYPE(c);
-    if (!c || TREE_CODE(c) != RECORD_TYPE ||
+    if (!c || TREE_CODE(c) != RECORD_TYPE || !TYPE_IDENTIFIER(t) ||
         strcmp(IDENTIFIER_POINTER(TYPE_IDENTIFIER(c)), "_Alloc_hider") != 0)
       return false;