From: Karel Zak Date: Wed, 15 May 2019 14:09:16 +0000 (+0200) Subject: lib/strutils: keep static analyzer happy [coverity scan] X-Git-Tag: v2.34-rc2~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d92f7d7bf3da6b3230a1a252df55f962b5f1361;p=thirdparty%2Futil-linux.git lib/strutils: keep static analyzer happy [coverity scan] Signed-off-by: Karel Zak --- diff --git a/lib/strutils.c b/lib/strutils.c index 8076574c5d..e170f560fc 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -869,8 +869,10 @@ int streq_paths(const char *a, const char *b) ((a_seg && *a_seg == '/') || (b_seg && *b_seg == '/'))) return 1; + if (!a_seg || !b_seg) + break; if (a_sz != b_sz || strncmp(a_seg, b_seg, a_sz) != 0) - return 0; + break; a = a_seg + a_sz; b = b_seg + b_sz;