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

Address use before NULL check warning of uvreq

move dereference of uvreq until the after NULL check.
This commit is contained in:
Mark Andrews
2021-09-28 10:08:26 +10:00
parent eeec53eb5d
commit 7079829b84

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);