summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-rr.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-07-23 04:04:19 +0200
committerLennart Poettering <lennart@poettering.net>2015-07-23 04:50:19 +0200
commitf5430a3ef308f3a102899fcaf7fbece757082f2a (patch)
treeca31992b7c4fff12ebcf2ec4f254a2b964b0ccd6 /src/resolve/resolved-dns-rr.h
parent6aafa9483d167f55a50e01f4dc5984866f12c8ec (diff)
resolve: unify memdup() code when parsing RRs
Let's make dns_packet_read_public_key() more generic by renaming it to dns_packet_read_memdup() (which more accurately describes what it does...). Then, patch all cases where we memdup() RR data to use this new call. This specifically checks for zero-length objects, and handles them gracefully. It will set zero length payload fields as a result. Special care should be taken to ensure that any code using this call can handle the returned allocated field to be NULL if the size is specified as 0!
Diffstat (limited to 'src/resolve/resolved-dns-rr.h')
-rw-r--r--src/resolve/resolved-dns-rr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-rr.h b/src/resolve/resolved-dns-rr.h
index bdd5a5c824..dc51126f97 100644
--- a/src/resolve/resolved-dns-rr.h
+++ b/src/resolve/resolved-dns-rr.h
@@ -53,7 +53,7 @@ struct DnsResourceRecord {
union {
struct {
void *data;
- uint16_t size;
+ size_t size;
} generic;
struct {