aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2011-03-22 11:46:19 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2011-03-22 11:46:19 +0000
commit7da04f9a77e89cbc5acdf199cfbcd9d8aed33faf (patch)
treed6e85b4cb0c5bd3899852ca81c749efce7442ff2 /tools
parent512d4201b02db6bff39d9f92858ad144f7f7450d (diff)
Allocate space for null termination in make_basename.
Coverity 710. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36247 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tools')
-rw-r--r--tools/lemon/lemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c
index 4ea4515e7c..25ec059368 100644
--- a/tools/lemon/lemon.c
+++ b/tools/lemon/lemon.c
@@ -1397,13 +1397,13 @@ make_basename(char* fullname)
#endif
if (!cp) {
- new_string = malloc( strlen(fullname) );
+ new_string = malloc( strlen(fullname) + 1 );
strcpy(new_string, fullname);
}
else {
/* skip the slash */
cp++;
- new_string = malloc( strlen(cp) );
+ new_string = malloc( strlen(cp) + 1 );
strcpy(new_string, cp);
}