[llvm-commits] [compiler-rt] r157047 - /compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Dmitry Vyukov
dvyukov at google.com
Fri May 18 01:53:16 PDT 2012
Author: dvyukov
Date: Fri May 18 03:53:16 2012
New Revision: 157047
URL: http://llvm.org/viewvc/llvm-project?rev=157047&view=rev
Log:
tsan: fix potential NULL deref
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=157047&r1=157046&r2=157047&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Fri May 18 03:53:16 2012
@@ -295,7 +295,7 @@
TSAN_INTERCEPTOR(int, strncmp, const char *s1, const char *s2, uptr n) {
SCOPED_TSAN_INTERCEPTOR(strncmp, s1, s2, n);
uptr len = 0;
- for (; s1[len] && s2[len] && len < n; len++) {
+ for (; len < n && s1[len] && s2[len]; len++) {
if (s1[len] != s2[len])
break;
}
More information about the llvm-commits
mailing list