chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
resolved: properly process SRV records
[elogind.git]
/
src
/
libsystemd-network
/
dhcp6-option.c
diff --git
a/src/libsystemd-network/dhcp6-option.c
b/src/libsystemd-network/dhcp6-option.c
index f488832cf919ca4406c3a192ee124b9b05cb8323..e9b382c17070c1266d213e11fe084703b3c68fcd 100644
(file)
--- a/
src/libsystemd-network/dhcp6-option.c
+++ b/
src/libsystemd-network/dhcp6-option.c
@@
-58,13
+58,14
@@
int dhcp6_option_append(uint8_t **buf, size_t *buflen, uint16_t code,
size_t optlen, const void *optval) {
int r;
size_t optlen, const void *optval) {
int r;
- assert_return(optval, -EINVAL);
+ assert_return(optval
|| optlen == 0
, -EINVAL);
r = option_append_hdr(buf, buflen, code, optlen);
if (r < 0)
return r;
r = option_append_hdr(buf, buflen, code, optlen);
if (r < 0)
return r;
- memcpy(*buf, optval, optlen);
+ if (optval)
+ memcpy(*buf, optval, optlen);
*buf += optlen;
*buflen -= optlen;
*buf += optlen;
*buflen -= optlen;