summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2018-06-19 17:15:13 +0200
committerGitHub <noreply@github.com>2018-06-19 17:15:13 +0200
commit6e87c6e8e2481cf102c32374a6a7139031426831 (patch)
treec830477296ac9f5fbc2d3cea48aed2e306a43826
parentMerge pull request #2373 from rubenk/specfile-cleanups (diff)
parentlib: uninitialized variable (Coverity 1469898) (diff)
downloadfrr-6e87c6e8e2481cf102c32374a6a7139031426831.tar.xz
frr-6e87c6e8e2481cf102c32374a6a7139031426831.zip
Merge pull request #2459 from pacovn/Coverity_1469898_Uninitialized_scalar_variable
lib: uninitialized variable (Coverity 1469898)
-rw-r--r--lib/frrstr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/frrstr.c b/lib/frrstr.c
index d003590ba..82c0ad773 100644
--- a/lib/frrstr.c
+++ b/lib/frrstr.c
@@ -78,6 +78,9 @@ char *frrstr_join(const char **parts, int argc, const char *join)
size_t len = 0;
size_t joinlen = join ? strlen(join) : 0;
+ if (!argc)
+ return NULL;
+
for (i = 0; i < argc; i++)
len += strlen(parts[i]);
len += argc * joinlen + 1;