]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/hints: fix dname bounds check
authorOto Šťáva <oto.stava@nic.cz>
Fri, 17 May 2024 11:22:51 +0000 (13:22 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Mon, 20 May 2024 10:18:42 +0000 (12:18 +0200)
This check was introduced to fix Clang-Tidy errors, but was factually
not completely correct, tripping Coverity Scan.

modules/hints/hints.c

index af05ee24e3b0332c072eaeb9faf491d555bc282a..2195ca3a258fe35cb816a655bd28e1c2462f09cc 100644 (file)
@@ -282,7 +282,7 @@ static int del_pair(struct hints_data *data, const char *name, const char *addr)
                return kr_error(EINVAL);
        }
        size_t key_len = knot_dname_size(key);
-       if (kr_fails_assert(key_len <= INT_MAX))
+       if (kr_fails_assert(key_len <= KNOT_DNAME_MAXLEN))
                return kr_error(EINVAL);
 
         if (addr) {