]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
options: Ensure that we correctly read auth tokens.
authorRoy Marples <roy@marples.name>
Fri, 29 Jul 2022 07:00:09 +0000 (08:00 +0100)
committerRoy Marples <roy@marples.name>
Fri, 29 Jul 2022 07:00:09 +0000 (08:00 +0100)
src/if-options.c

index dd70c80656b221f16466966dc42b3ee1354bd3c7..46ea7ea0199d8b27826e2d7de2efa6d27fc38cd6 100644 (file)
@@ -266,6 +266,8 @@ parse_str(char *sbuf, size_t slen, const char *str, int flags)
                }
        } else {
                l = (size_t)hwaddr_aton(NULL, str);
+               if (sbuf == NULL)
+                       return (ssize_t)l;
                if ((ssize_t) l != -1 && l > 1) {
                        if (l > slen) {
                                errno = ENOBUFS;