From: Roy Marples Date: Wed, 10 Jun 2020 13:38:46 +0000 (+0100) Subject: dhcpcd: Ensure dump is terminated X-Git-Tag: v9.1.2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df2825c97b9eda01fc4a5eef2f4d884cc252f916;p=thirdparty%2Fdhcpcd.git dhcpcd: Ensure dump is terminated --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index dc21583b..e030ff38 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -1659,6 +1659,8 @@ dhcpcd_readdump2(void *arg) return; } + if (ctx->ctl_buf[ctx->ctl_buflen - 1] != '\0') /* unlikely */ + ctx->ctl_buf[ctx->ctl_buflen - 1] = '\0'; script_dump(ctx->ctl_buf, ctx->ctl_buflen); fflush(stdout); if (--ctx->ctl_extra != 0) {