]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
keymgr: mute uninitialized pointer read (Coverity)
authorDaniel Salzman <daniel.salzman@nic.cz>
Mon, 31 Dec 2018 09:16:15 +0000 (10:16 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Mon, 31 Dec 2018 09:16:15 +0000 (10:16 +0100)
src/utils/keymgr/functions.c

index 50703ec9754d5f4832593bdfe4eed77babe24c38..c755129bd30de2b5d5c39ff3a411fc84ee423b7e 100644 (file)
@@ -588,10 +588,8 @@ int keymgr_nsec3_salt_set(kdnssec_ctx_t *ctx, const char *new_salt)
 {
        assert(new_salt);
 
-       dnssec_binary_t salt_bin;
-       if (strcmp(new_salt, "-") == 0) {
-               salt_bin.size = 0;
-       } else {
+       dnssec_binary_t salt_bin = { 0 };
+       if (strcmp(new_salt, "-") != 0) {
                salt_bin.data = hex_to_bin(new_salt, &salt_bin.size);
                if (salt_bin.data == NULL) {
                        return KNOT_EMALF;