changeset 4:0420bfe96dda

Fix off-by-one memory allocation error
author Adam Chlipala <adam@chlipala.net>
date Sat, 26 Dec 2015 14:15:12 -0500
parents 9ab026c81a22
children d163044ae493
files mail.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mail.c	Wed Dec 31 08:00:42 2014 -0500
+++ b/mail.c	Sat Dec 26 14:15:12 2015 -0500
@@ -75,7 +75,7 @@
 
   address(ctx, s);
   if (h2->to) {
-    uw_Basis_string all = uw_malloc(ctx, strlen(h2->to) + 1 + strlen(s));
+    uw_Basis_string all = uw_malloc(ctx, strlen(h2->to) + 2 + strlen(s));
     sprintf(all, "%s,%s", h2->to, s);
     h2->to = all;
   } else