summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@sunilnimmagadda.com>2014-04-01 19:34:21 +0500
committerSunil Nimmagadda <sunil@sunilnimmagadda.com>2014-04-01 19:34:21 +0500
commit0f586da43d3866e738cc30eb5b85ce2ac7a508a1 (patch)
tree837a1a9c263cb8a9c30961a19c5e91d101dbd53b
parent9a76381d5a868d57a9f4e557a21c7e6a9dcae516 (diff)
Properly NUL terminate expanded path by memsetting it.
-rw-r--r--maildrop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/maildrop.c b/maildrop.c
index ce242f9..edc47b7 100644
--- a/maildrop.c
+++ b/maildrop.c
@@ -143,6 +143,7 @@ expand(char *dst, const char *src, size_t dst_sz, struct passwd *pw)
size_t i = 0, r;
int c;
+ memset(dst, 0, dst_sz);
while ((c = *src++)) {
if (i >= dst_sz)
break;