[Bug sanitizer/69276] Address sanitizer does not handle heap overflow

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 14 16:24:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69276

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Comment on attachment 37341
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37341
suggested patch

+  else if (is_gimple_call (stmt) && gimple_store_p (stmt)
+          && gimple_clobber_p (stmt))
+    {
+      asan_mem_ref r;
+      asan_mem_ref_init (&r, NULL, 1);
+
+      r.start = gimple_call_lhs (stmt);
+      r.access_size = int_size_in_bytes (TREE_TYPE (r.start));
+      return has_mem_ref_been_instrumented (&r);
+    }
+

This condition is never true, did you mean !gimple_clobber_p instead?
But obviously calls are never clobbers, so there is no need to test that.


More information about the Gcc-bugs mailing list