2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

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.
This commit is contained in:
Aram Sargsyan
2021-09-03 00:59:57 +00:00
parent ae53919154
commit ae9330b641

View File

@@ -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);