From: Willem Toorop Date: Tue, 16 Jul 2013 20:08:42 +0000 (+0200) Subject: Properly initialize bitmap X-Git-Tag: release-1.6.17rc1~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d6fac6c06f4509568c1a3f3b2d0e364cd2254a5;p=thirdparty%2Fldns.git Properly initialize bitmap --- diff --git a/README.svn b/README.git similarity index 100% rename from README.svn rename to README.git diff --git a/dnssec.c b/dnssec.c index 56c6b628..856275d2 100644 --- a/dnssec.c +++ b/dnssec.c @@ -731,7 +731,7 @@ ldns_dnssec_create_nsec_bitmap(ldns_rr_type rr_type_list[], if (sz > 0) { /* Format rdf data according RFC3845 Section 2.1.2 (see above) */ - dptr = data = LDNS_XMALLOC(uint8_t, sz); + dptr = data = LDNS_CALLOC(uint8_t, sz); if (!data) { return NULL; } 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]; } }