From: Mark Andrews Date: Wed, 8 Jul 2026 02:08:38 +0000 (+1000) Subject: Properly check test-syncplugin skip label for equality X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8500949cc962e10a15bdb6d4c87ccb7454703b21;p=thirdparty%2Fbind9.git Properly check test-syncplugin skip label for equality The label length and the string length where not being checked so a label that started with a string that matched the skip label would incorrectly match. --- diff --git a/bin/tests/system/hooks/driver/test-syncplugin.c b/bin/tests/system/hooks/driver/test-syncplugin.c index 3ac08a2dc99..ef85ef4b833 100644 --- a/bin/tests/system/hooks/driver/test-syncplugin.c +++ b/bin/tests/system/hooks/driver/test-syncplugin.c @@ -38,6 +38,7 @@ syncplugin__hook(void *arg, void *cbdata, isc_result_t *resp) { if (inst->firstlbl != NULL) { const dns_name_t *qname = qctx->client->query.qname; dns_label_t label; + size_t len = strlen(inst->firstlbl); dns_name_getlabel(qname, 0, &label); @@ -45,8 +46,8 @@ syncplugin__hook(void *arg, void *cbdata, isc_result_t *resp) { * +1 because the first label byte is the length of the label * itself */ - if (strncmp(inst->firstlbl, (char *)label.base + 1, - strlen(inst->firstlbl)) == 0) + if (*label.base == len && + strncmp(inst->firstlbl, (char *)label.base + 1, len) == 0) { return NS_HOOK_CONTINUE; }