Blame SOURCES/0029-Fix-segfault-in-config-file-parser.patch

90e381
From 34b9e1d10c6be736f1b20be8795c655446f38c5e Mon Sep 17 00:00:00 2001
90e381
From: Martin Sehnoutka <msehnout@redhat.com>
90e381
Date: Thu, 17 Nov 2016 13:14:55 +0100
90e381
Subject: [PATCH 29/59] Fix segfault in config file parser.
90e381
90e381
---
90e381
 str.c | 2 +-
90e381
 1 file changed, 1 insertion(+), 1 deletion(-)
90e381
90e381
diff --git a/str.c b/str.c
90e381
index 41b27db..82b8ae4 100644
90e381
--- a/str.c
90e381
+++ b/str.c
90e381
@@ -113,7 +113,7 @@ str_strdup_trimmed(const struct mystr* p_str)
90e381
   for (h = 0; h < (int)str_getlen(p_str) && vsf_sysutil_isspace(p_trimmed[h]); h++) ;
90e381
   for (t = str_getlen(p_str) - 1; t >= 0 && vsf_sysutil_isspace(p_trimmed[t]); t--) ;
90e381
   newlen = t - h + 1;
90e381
-  return newlen ? vsf_sysutil_strndup(p_trimmed+h, (unsigned int)newlen) : 0L;
90e381
+  return (newlen > 0) ? vsf_sysutil_strndup(p_trimmed+h, (unsigned int)newlen) : 0L;
90e381
 }
90e381
 
90e381
 void
90e381
-- 
90e381
2.14.4
90e381