From: Roy Marples Date: Wed, 31 Dec 2025 10:12:24 +0000 (+0000) Subject: options: Don't assume vsio options have an argument (#578) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd0b26953cc88b179dade20f585e4c5e1f7c1062;p=thirdparty%2Fdhcpcd.git options: Don't assume vsio options have an argument (#578) * options: Don't assume vsio options have an argument Should fix #577. --- diff --git a/src/if-options.c b/src/if-options.c index b55e65d6..60f8e660 100644 --- a/src/if-options.c +++ b/src/if-options.c @@ -936,7 +936,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, return -1; #else fp = strwhite(arg); - if (fp) + if (fp != NULL) *fp++ = '\0'; u = (uint32_t)strtou(arg, NULL, 0, 0, UINT32_MAX, &e); if (e) { @@ -944,9 +944,13 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, return -1; } - fp = strskipwhite(fp); - p = strchr(fp, ','); - if (!p || !p[1]) { + if (fp != NULL) + fp = strskipwhite(fp); + if (fp != NULL) + p = strchr(fp, ','); + else + p = NULL; + if (p == NULL || p[1] == '\0') { logerrx("invalid vendor format: %s", arg); return -1; }