Properly NUL terminate expanded path by memsetting it.
authorSunil Nimmagadda <sunil@sunilnimmagadda.com>
Tue, 01 Apr 2014 19:34:51 +0500
changeset 3 a32da8616e0e
parent 2 6e7b98264ea2
child 6 c911413d912d
Properly NUL terminate expanded path by memsetting it.
maildrop.c
--- a/maildrop.c	Tue Apr 01 16:15:19 2014 +0500
+++ b/maildrop.c	Tue Apr 01 19:34:51 2014 +0500
@@ -143,6 +143,7 @@
 	size_t	i = 0, r;
 	int	c;
 
+	memset(dst, 0, dst_sz);
 	while ((c = *src++)) {
 		if (i >= dst_sz)
 			break;