]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
zone-diff: fix possible uninitialized pointer read (Coverity)
authorDaniel Salzman <daniel.salzman@nic.cz>
Mon, 23 Aug 2021 07:13:21 +0000 (09:13 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 25 Aug 2021 15:22:56 +0000 (17:22 +0200)
src/knot/zone/zone-diff.c

index 71ce786069785d5a7a4a64676ce5bd356c01463c..cf6d8c72c08d9568b1a2b0d43d01f6bb9134ae1d 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2021 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -175,8 +175,8 @@ static int diff_rrsets(const knot_rrset_t *rrset1, const knot_rrset_t *rrset2,
         * to add all RRs that had no match, but those from second RRSet. */
 
        /* Get RRs to add to zone and to remove from zone. */
-       knot_rrset_t to_remove;
-       knot_rrset_t to_add;
+       knot_rrset_t to_remove = { 0 };
+       knot_rrset_t to_add = { 0 };
        if (rrset1 != NULL && rrset2 != NULL) {
                int ret = rdata_return_changes(rrset1, rrset2, &to_remove);
                if (ret != KNOT_EOK) {