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

Merge branch '2909-pointers-used-before-validation' into 'main'

Resolve "Pointers used before validation"

Closes #2909

See merge request isc-projects/bind9!5443
This commit is contained in:
Mark Andrews
2021-09-29 01:41:25 +00:00
3 changed files with 10 additions and 7 deletions

View File

@@ -2730,8 +2730,7 @@ isc__nm_async_readcb(isc__networker_t *worker, isc__netievent_t *ev0) {
isc_nmsocket_t *sock = ievent->sock;
isc__nm_uvreq_t *uvreq = ievent->req;
isc_result_t eresult = ievent->result;
isc_region_t region = { .base = (unsigned char *)uvreq->uvbuf.base,
.length = uvreq->uvbuf.len };
isc_region_t region;
UNUSED(worker);
@@ -2740,6 +2739,9 @@ isc__nm_async_readcb(isc__networker_t *worker, isc__netievent_t *ev0) {
REQUIRE(VALID_NMHANDLE(uvreq->handle));
REQUIRE(sock->tid == isc_nm_tid());
region.base = (unsigned char *)uvreq->uvbuf.base;
region.length = uvreq->uvbuf.len;
uvreq->cb.recv(uvreq->handle, eresult, &region, uvreq->cbarg);
isc__nm_uvreq_put(&uvreq, sock);

View File

@@ -1110,10 +1110,9 @@ isc__nm_async_tcpdnssend(isc__networker_t *worker, isc__netievent_t *ev0) {
isc__netievent_tcpdnssend_t *ievent =
(isc__netievent_tcpdnssend_t *)ev0;
REQUIRE(ievent->sock->type == isc_nm_tcpdnssocket);
REQUIRE(ievent->sock->tid == isc_nm_tid());
REQUIRE(VALID_NMSOCK(ievent->sock));
REQUIRE(VALID_UVREQ(ievent->req));
REQUIRE(VALID_NMSOCK(ievent->sock));
REQUIRE(ievent->sock->type == isc_nm_tcpdnssocket);
REQUIRE(ievent->sock->tid == isc_nm_tid());
isc_result_t result;

View File

@@ -2247,12 +2247,14 @@ cleanup:
void
cfg_print_spacelist(cfg_printer_t *pctx, const cfg_obj_t *obj) {
const cfg_list_t *list = &obj->value.list;
const cfg_listelt_t *elt;
const cfg_list_t *list = NULL;
const cfg_listelt_t *elt = NULL;
REQUIRE(pctx != NULL);
REQUIRE(obj != NULL);
list = &obj->value.list;
for (elt = ISC_LIST_HEAD(*list); elt != NULL;
elt = ISC_LIST_NEXT(elt, link)) {
cfg_print_obj(pctx, elt->obj);