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:
@@ -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, ®ion, uvreq->cbarg);
|
||||
|
||||
isc__nm_uvreq_put(&uvreq, sock);
|
||||
|
Reference in New Issue
Block a user