summaryrefslogtreecommitdiff
path: root/rr.c
diff options
context:
space:
mode:
authorWillem Toorop <willem@nlnetlabs.nl>2013-07-16 22:08:42 +0200
committerWillem Toorop <willem@nlnetlabs.nl>2013-07-16 22:08:42 +0200
commit4d6fac6c06f4509568c1a3f3b2d0e364cd2254a5 (patch)
tree9607c1a93c33b32aedc35915e626b3df94eccf18 /rr.c
parent976fdc0b38099cf8c5155b3cfef01d4863842993 (diff)
downloadldns-4d6fac6c06f4509568c1a3f3b2d0e364cd2254a5.tar.gz
Properly initialize bitmap
Diffstat (limited to 'rr.c')
-rw-r--r--rr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rr.c b/rr.c
index cb971161..0ecc6970 100644
--- a/rr.c
+++ b/rr.c
@@ -2460,6 +2460,7 @@ ldns_rdf_bitmap_known_rr_types_set(ldns_rdf** rdf, int value)
/* Format rdf data according RFC3845 Section 2.1.2 (see above)
*/
dptr = data = LDNS_XMALLOC(uint8_t, sz);
+ memset(data, value, sz);
if (!data) {
return LDNS_STATUS_MEM_ERR;
}
@@ -2467,7 +2468,6 @@ ldns_rdf_bitmap_known_rr_types_set(ldns_rdf** rdf, int value)
if (windows[i]) {
*dptr++ = (uint8_t)i;
*dptr++ = (uint8_t)(windows[i] / 8 + 1);
- memset(dptr, value, dptr[-1]);
dptr += dptr[-1];
}
}