]> granicus.if.org Git - sudo/commitdiff
Silence a clang analyzer false positive.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 22 Dec 2017 20:27:08 +0000 (13:27 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 22 Dec 2017 20:27:08 +0000 (13:27 -0700)
plugins/sudoers/logging.c

index 79aa7e4b32130918e819107dafcd00bcc845e4e3..ef62736a59bafbe316b7d5cfd5e35d63c4563f94 100644 (file)
@@ -469,6 +469,11 @@ done:
     *dst = '\0';
 
     *str = dst0;
+#ifdef __clang_analyzer__
+    /* clang analyzer false positive */
+    if (__builtin_expect(dst < dst0, 0))
+       __builtin_trap();
+#endif
     debug_return_int(dst - dst0);
 }