[PATCH] Interceptors etc for standalone LSan.
Alexander Potapenko
glider at google.com
Tue Apr 23 03:57:47 PDT 2013
================
Comment at: lib/lsan/lsan_interceptors.cc:46
@@ +45,3 @@
+ Init();
+ GET_STACK_TRACE(flags()->stack_trace_size, flags()->fast_unwind);
+ void *p = Allocate(stack, size, 8);
----------------
Looks like you're always calling GET_STACK_TRACE(flags()->stack_trace_size, flags()->fast_unwind). Can it be just GET_STACK_TRACE then?
================
Comment at: lib/lsan/lsan_interceptors.cc:59
@@ +58,3 @@
+ GET_STACK_TRACE(flags()->stack_trace_size, flags()->fast_unwind);
+ size *= nmemb;
+ void *p = Allocate(stack, size, 8, false);
----------------
Multiplication overflow here leads to a security vulnerability. Please use CallocShouldReturnNullDueToOverflow() from sanitizer_common.h
http://llvm-reviews.chandlerc.com/D702
More information about the llvm-commits
mailing list