stdstring fix attempt
MODIFY
instrumentation/afl-compiler-rt.o.c
instrumentation/afl-compiler-rt.o.c
@@ -1653,12 +1653,19 @@ static u8 *get_llvm_stdstring(u8 *string) {
void __cmplog_rtn_gcc_stdstring_cstring(u8 *stdstring, u8 *cstring) {
+ if (unlikely(!__afl_cmp_map)) return;
+ if (!area_is_mapped(stdstring, 32) || !area_is_mapped(cstring, 32)) return;
+
__cmplog_rtn_hook(get_gcc_stdstring(stdstring), cstring);
}
void __cmplog_rtn_gcc_stdstring_stdstring(u8 *stdstring1, u8 *stdstring2) {
+ if (unlikely(!__afl_cmp_map)) return;
+ if (!area_is_mapped(stdstring1, 32) || !area_is_mapped(stdstring2, 32))
+ return;
+
__cmplog_rtn_hook(get_gcc_stdstring(stdstring1),
get_gcc_stdstring(stdstring2));
@@ -1666,12 +1673,17 @@ void __cmplog_rtn_gcc_stdstring_stdstring(u8 *stdstring1, u8 *stdstring2) {
void __cmplog_rtn_llvm_stdstring_cstring(u8 *stdstring, u8 *cstring) {
+ if (unlikely(!__afl_cmp_map)) return;
+ if (!area_is_mapped(stdstring, 32) || !area_is_mapped(cstring, 32)) return;
__cmplog_rtn_hook(get_llvm_stdstring(stdstring), cstring);
}
void __cmplog_rtn_llvm_stdstring_stdstring(u8 *stdstring1, u8 *stdstring2) {
+ if (unlikely(!__afl_cmp_map)) return;
+ if (!area_is_mapped(stdstring1, 32) || !area_is_mapped(stdstring2, 32))
+ return;
__cmplog_rtn_hook(get_llvm_stdstring(stdstring1),
get_llvm_stdstring(stdstring2));

stdstring fix attempt