Skip to content

Commit 4a48981

Browse files
committed
Merge pull request #2 from josealf/master
Fix bug - buf must be null terminated
2 parents 86df2e1 + 5a1cb04 commit 4a48981

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bdecli.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,10 @@ int bde_cfg_add_entry(bde_entry_t *list, char *szFQNPath, char *szName, char *sz
572572
return 0;
573573
}
574574

575-
if ('\\' == tmp[i])
575+
if ('\\' == tmp[i]) {
576576
strncpy_s(buf, MAX_BUFFER, tmp, i);
577+
buf[i] = 0;
578+
}
577579
else
578580
strcpy_s(buf, MAX_BUFFER, tmp);
579581

0 commit comments

Comments
 (0)