Fix out-of-bounds error when incorporating email from stdin
[mmh] / sbr / concat.c
index 5c519e9..9efe731 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <h/mh.h>
 #include <h/utils.h>
+#include <stdarg.h>
 
 
 static char *
@@ -35,7 +36,7 @@ concat(char *s1, ...)
                len += strlen(cp);
        va_end(list);
 
-       dp = sp = mh_xmalloc(len);
+       dp = sp = mh_xcalloc(len, sizeof(char));
 
        sp = copy(s1, sp);