From 918a33b717db3df1caca4ef58bc891cbd10966da Mon Sep 17 00:00:00 2001 Message-Id: <918a33b717db3df1caca4ef58bc891cbd10966da.1714765101.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] common/util.c, server/admin.c: Ensure null-termination of result strings. Organization: Straylight/Edgeware From: Mark Wooding `dstr_putc' has a sharp edge here. Apparently I wasn't careful enough. --- common/util.c | 1 + server/admin.c | 1 + 2 files changed, 2 insertions(+) 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); } -- [mdw]