summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-13 11:15:41 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-13 11:15:41 +0100
commit91ba5ac7d0196074863ff08f5251689d324a6550 (patch)
treec12c05be46f21a42d30f2bf1b46d1207db49db89 /src/libsystemd/sd-resolve
parent6c3bedd5cfef5c70185fbbac33829c5c11686669 (diff)
parent718af59e9ac1a525b0a73b99a74bc376f1b4d49d (diff)
Merge pull request #2589 from keszybz/resolve-tool-2
Better support of OPENPGPKEY, CAA, TLSA packets and tests
Diffstat (limited to 'src/libsystemd/sd-resolve')
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index 653dbfbe57..de17a6112e 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -217,9 +217,8 @@ static void *serialize_addrinfo(void *p, const struct addrinfo *ai, size_t *leng
memcpy((uint8_t*) p, &s, sizeof(AddrInfoSerialization));
memcpy((uint8_t*) p + sizeof(AddrInfoSerialization), ai->ai_addr, ai->ai_addrlen);
-
- if (ai->ai_canonname)
- memcpy((char*) p + sizeof(AddrInfoSerialization) + ai->ai_addrlen, ai->ai_canonname, cnl);
+ memcpy_safe((char*) p + sizeof(AddrInfoSerialization) + ai->ai_addrlen,
+ ai->ai_canonname, cnl);
*length += l;
return (uint8_t*) p + l;