From: Mark Wooding Date: Thu, 26 May 2016 08:26:09 +0000 (+0100) Subject: common/util.c, server/admin.c: Ensure null-termination of result strings. X-Git-Tag: 1.0.0pre19~32 X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/918a33b717db3df1caca4ef58bc891cbd10966da common/util.c, server/admin.c: Ensure null-termination of result strings. `dstr_putc' has a sharp edge here. Apparently I wasn't careful enough. --- diff --git a/common/util.c b/common/util.c index 78358b31..3de554d7 100644 --- a/common/util.c +++ b/common/util.c @@ -70,6 +70,7 @@ void u_quotify(dstr *d, const char *p) } dstr_putc(d, '\"'); } + dstr_putz(d); } /* --- @u_getuser@ --- * diff --git a/server/admin.c b/server/admin.c index 3257c7da..06922dbb 100644 --- a/server/admin.c +++ b/server/admin.c @@ -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); }