chiark / gitweb /
common/util.c, server/admin.c: Ensure null-termination of result strings.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 23 Apr 2017 03:06:07 +0000 (04:06 +0100)
`dstr_putc' has a sharp edge here.  Apparently I wasn't careful enough.

common/util.c
server/admin.c

index 78358b31c2c42ed5645c38af7e69b33da80bcb23..3de554d72a35d1530f09bc86b7af0b54604ac79f 100644 (file)
@@ -70,6 +70,7 @@ void u_quotify(dstr *d, const char *p)
     }
     dstr_putc(d, '\"');
   }
+  dstr_putz(d);
 }
 
 /* --- @u_getuser@ --- *
index 3257c7da2807e43d7192c3a241bcfd986fd866aa..06922dbb18f0509d4525814a4e3b67e1ef3bba09 100644 (file)
@@ -311,6 +311,7 @@ void a_vformat(dstr *d, const char *fmt, va_list *ap)
     }
     fmt = va_arg(*ap, const char *);
   }
+  dstr_putz(d);
 
   dstr_destroy(&dd);
 }