]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
bugfix #1570: Potential NULL dereferences
authorWillem Toorop <willem@nlnetlabs.nl>
Mon, 16 Oct 2017 09:51:11 +0000 (11:51 +0200)
committerWillem Toorop <willem@nlnetlabs.nl>
Mon, 16 Oct 2017 09:51:11 +0000 (11:51 +0200)
Thanks Bill Parker

Changelog
rr.c

index 45f03691cb07b06e3490e6db4ad9e187ebee4aa9..3dc27e3fe9b6894a45bf64830b48a10b96a6e0ac 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,5 @@
 1.7.1  ????-??-??
-       * bugfix #1566, #1568, #1569: Possible NULL Pointer Dereferences
+       * bugfix #1566, #1568, #1569, #1570: Potential NULL Dereferences
          Thanks Bill Parker
        * bugfix #1260: Anticipate strchr returning NULL on unfound char
          Thanks Stephan Zeisberg
diff --git a/rr.c b/rr.c
index a1efb2492fa968e6bb968d607babd18be95d86c2..7d74fea40b75c4eea93f5cd339cb2a58203934f4 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -2545,10 +2545,10 @@ 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;
                }
+               memset(data, value, sz);
                for (i = 0; i < 256; i++) {
                        if (windows[i]) {
                                *dptr++ = (uint8_t)i;