From: Oto Šťáva Date: Fri, 17 May 2024 11:22:51 +0000 (+0200) Subject: modules/hints: fix dname bounds check X-Git-Tag: v5.7.3~3^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b185a8be6be57aab97ba6fc69ba72d2a5005e728;p=thirdparty%2Fknot-resolver.git modules/hints: fix dname bounds check This check was introduced to fix Clang-Tidy errors, but was factually not completely correct, tripping Coverity Scan. --- diff --git a/modules/hints/hints.c b/modules/hints/hints.c index af05ee24e..2195ca3a2 100644 --- a/modules/hints/hints.c +++ b/modules/hints/hints.c @@ -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) {