Skip to content

Commit

Permalink
libconfig: pass actual buffer length to strlcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
rsto committed Oct 17, 2019
1 parent 5ffb2ac commit 3bcc8c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libconfig.c
Expand Up @@ -202,7 +202,7 @@ EXPORTED int config_parseduration(const char *str, int defunit, int *out_duratio

/* make a copy and append the default unit if necessary */
copy = xzmalloc(len + 2);
strlcpy(copy, str, sizeof(copy));
strlcpy(copy, str, len + 2);
if (cyrus_isdigit(copy[len-1]))
copy[len] = defunit;

Expand Down

0 comments on commit 3bcc8c1

Please sign in to comment.