From 6d92f7d7bf3da6b3230a1a252df55f962b5f1361 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 15 May 2019 16:09:16 +0200 Subject: lib/strutils: keep static analyzer happy [coverity scan] Signed-off-by: Karel Zak --- lib/strutils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/strutils.c b/lib/strutils.c index 8076574c5..e170f560f 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; -- cgit v1.2.3-55-g7522