Skip to content

Commit f6471dd

Browse files
committed
fix gcc cmplog crash
1 parent f0ccca1 commit f6471dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

instrumentation/afl-gcc-cmptrs-pass.so.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ struct afl_cmptrs_pass : afl_base_pass {
157157
/* We expect it to be a record type. */
158158
if (TREE_CODE(t) != RECORD_TYPE) return false;
159159

160+
/* The type has an identifier. */
161+
if (!TYPE_IDENTIFIER(t)) return false;
162+
160163
/* The type of the template is basic_string. */
161164
if (strcmp(IDENTIFIER_POINTER(TYPE_IDENTIFIER(t)), "basic_string") != 0)
162165
return false;
@@ -201,7 +204,7 @@ struct afl_cmptrs_pass : afl_base_pass {
201204
/* Now go back to the first data member. Its type should be a
202205
record type named _Alloc_hider. */
203206
c = TREE_TYPE(c);
204-
if (!c || TREE_CODE(c) != RECORD_TYPE ||
207+
if (!c || TREE_CODE(c) != RECORD_TYPE || !TYPE_IDENTIFIER(t) ||
205208
strcmp(IDENTIFIER_POINTER(TYPE_IDENTIFIER(c)), "_Alloc_hider") != 0)
206209
return false;
207210

0 commit comments

Comments
 (0)