From: Roy Marples Date: Wed, 10 Apr 2019 21:58:36 +0000 (+0100) Subject: options: terminate strings that are not quoted X-Git-Tag: v7.2.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18b8f29119c17f2752a74e832a7a05aac6a6d5fc;p=thirdparty%2Fdhcpcd.git options: terminate strings that are not quoted --- diff --git a/src/if-options.c b/src/if-options.c index 3c00b82e..e853bc90 100644 --- a/src/if-options.c +++ b/src/if-options.c @@ -388,9 +388,11 @@ parse_string_hwaddr(char *sbuf, size_t slen, const char *str, int clid) } if (punt_last) { if (sbuf) - *--sbuf = '\0'; + --sbuf; l--; } + if (sbuf) + *sbuf = '\0'; return (ssize_t)l; }