mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:25:38 +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:
@@ -886,9 +886,10 @@ typedef enum {
|
|||||||
|
|
||||||
static bool
|
static bool
|
||||||
catz_opt_cmp(const dns_label_t *option, const char *opt) {
|
catz_opt_cmp(const dns_label_t *option, const char *opt) {
|
||||||
unsigned int l = strlen(opt);
|
size_t len = strlen(opt);
|
||||||
if (option->length - 1 == l &&
|
|
||||||
memcmp(opt, option->base + 1, l - 1) == 0) {
|
if (option->length - 1 == len &&
|
||||||
|
memcmp(opt, option->base + 1, len) == 0) {
|
||||||
return (true);
|
return (true);
|
||||||
} else {
|
} else {
|
||||||
return (false);
|
return (false);
|
||||||
|
Reference in New Issue
Block a user