summaryrefslogtreecommitdiff
path: root/lib/addns
diff options
context:
space:
mode:
Diffstat (limited to 'lib/addns')
-rw-r--r--lib/addns/dnsmarshall.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/addns/dnsmarshall.c b/lib/addns/dnsmarshall.c
index 6c93b98144f..c95420304f0 100644
--- a/lib/addns/dnsmarshall.c
+++ b/lib/addns/dnsmarshall.c
@@ -88,7 +88,9 @@ void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
buf->data = new_data;
}
- memcpy(buf->data + buf->offset, data, len);
+ if (data != NULL) {
+ memcpy(buf->data + buf->offset, data, len);
+ }
buf->offset += len;
return;
}