+4574. [bug] Dig leaked memory with multiple +subnet options.
+ [RT #44683]
+
4573. [func] Query logic has been substantially refactored (e.g.
query_find function has been split into smaller
functions) for improved readability, maintainability
}
if (lookup->edns == -1)
lookup->edns = 0;
-
+ if (lookup->ecs_addr != NULL) {
+ isc_mem_free(mctx, lookup->ecs_addr);
+ lookup->ecs_addr = NULL;
+ }
result = parse_netprefix(&lookup->ecs_addr, value);
if (result != ISC_R_SUCCESS)
fatal("Couldn't parse client");
isc_boolean_t prefix_parsed = ISC_FALSE;
char buf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX/128")];
+ REQUIRE(sap != NULL && *sap == NULL);
+
if (strlcpy(buf, value, sizeof(buf)) >= sizeof(buf))
fatal("invalid prefix '%s'\n", value);
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+ n=`expr $n + 1`
+ echo "I:checking dig +subnet +subnet ($n)"
+ ret=0
+ $DIG $DIGOPTS +tcp @10.53.0.2 +subnet=127.0.0.0 +subnet=127.0.0.1 A a.example > dig.out.test$n 2>&1 || ret=1
+ grep "CLIENT-SUBNET: 127.0.0.1/32/0" < dig.out.test$n > /dev/null || ret=1
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+
n=`expr $n + 1`
echo "I:checking dig +subnet with various prefix lengths ($n)"
ret=0