summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaco <paco@voltanet.io>2018-06-15 15:05:12 +0200
committerpaco <paco@voltanet.io>2018-06-15 19:13:58 +0200
commit2c2d5cb397c140c05ad81e8c79273bd3af13b595 (patch)
treedc27d21693e6b68f18feed77e52002b54f0a0e47
parentMerge pull request #2426 from pacovn/Coverity_23089_Buffer_not_null_terminated (diff)
downloadfrr-2c2d5cb397c140c05ad81e8c79273bd3af13b595.tar.xz
frr-2c2d5cb397c140c05ad81e8c79273bd3af13b595.zip
lib: uninitialized variable (Coverity 1469898)
Signed-off-by: F. Aragon <paco@voltanet.io>
Diffstat (limited to '')
-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;