]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not allow empty DoH endpoints to be added
authorArtem Boldariev <artem@boldariev.com>
Wed, 12 May 2021 08:53:35 +0000 (11:53 +0300)
committerArtem Boldariev <artem@boldariev.com>
Thu, 13 May 2021 07:42:25 +0000 (10:42 +0300)
It was possible to specify empty DoH endpoint in BIND's configuration
file: that was an error, we should not allow doing so.

lib/isc/netmgr/http.c

index 8ac2dd5ed8df2d04c1a1cef57d64a9e1df418f44..599dd861114121d8e4e6fae663bbd638977e6fcb 100644 (file)
@@ -2205,6 +2205,7 @@ isc_nm_http_endpoint(isc_nmsocket_t *sock, const char *uri, isc_nm_recv_cb_t cb,
 
        REQUIRE(VALID_NMSOCK(sock));
        REQUIRE(sock->type == isc_nm_httplistener);
+       REQUIRE(uri != NULL && *uri != '\0');
 
        httpcbarg = isc_mem_get(sock->mgr->mctx, sizeof(isc_nm_httpcbarg_t));
        *httpcbarg = (isc_nm_httpcbarg_t){ .cb = cb, .cbarg = cbarg };