Module Name: src
Committed By: roy
Date: Fri Dec 20 22:24:59 UTC 2019
Modified Files:
src/external/bsd/dhcpcd/dist/src: if-options.c
Log Message:
Sync
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/dhcpcd/dist/src/if-options.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/dhcpcd/dist/src/if-options.c
diff -u src/external/bsd/dhcpcd/dist/src/if-options.c:1.18 src/external/bsd/dhcpcd/dist/src/if-options.c:1.19
--- src/external/bsd/dhcpcd/dist/src/if-options.c:1.18 Fri Oct 11 11:03:59 2019
+++ src/external/bsd/dhcpcd/dist/src/if-options.c Fri Dec 20 22:24:59 2019
@@ -393,8 +393,16 @@ parse_str(char *sbuf, size_t slen, const
str++;
}
}
- if (flags == PARSE_STRING_NULL && sbuf)
- *sbuf = '\0';
+ if (flags == PARSE_STRING_NULL) {
+ l++;
+ if (sbuf != NULL) {
+ if (l > slen) {
+ errno = ENOBUFS;
+ return -1;
+ }
+ *sbuf = '\0';
+ }
+ }
return (ssize_t)l;
}