From: Aram Sargsyan Date: Fri, 3 Sep 2021 00:59:57 +0000 (+0000) Subject: Fix an off-by-one error in catz_opt_cmp() function X-Git-Tag: v9.17.19~44^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae9330b64181e32feb4f2e278a38afd6f4c77609;p=thirdparty%2Fbind9.git Fix an off-by-one error in catz_opt_cmp() function This commit fixes an off-by-one error in catz_opt_cmp() function which was resulting in ignoring the last character of the compared string. --- diff --git a/lib/dns/catz.c b/lib/dns/catz.c index 3f60afaf35c..f946d9dab6d 100644 --- a/lib/dns/catz.c +++ b/lib/dns/catz.c @@ -886,9 +886,10 @@ typedef enum { static bool catz_opt_cmp(const dns_label_t *option, const char *opt) { - unsigned int l = strlen(opt); - if (option->length - 1 == l && - memcmp(opt, option->base + 1, l - 1) == 0) { + size_t len = strlen(opt); + + if (option->length - 1 == len && + memcmp(opt, option->base + 1, len) == 0) { return (true); } else { return (false);