From f2fdda1aa7273525bf712c0591618a4c067c3d1c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 22 Dec 2017 13:27:08 -0700 Subject: [PATCH] Silence a clang analyzer false positive. --- plugins/sudoers/logging.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 79aa7e4b3..ef62736a5 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -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); } -- 2.40.0