mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
lib/isc/buffer.c: Fix invalid order of DbC checks that could cause dereference before NULL check
This commit is contained in:
@@ -550,10 +550,11 @@ isc_buffer_allocate(isc_mem_t *mctx, isc_buffer_t **dynbuffer,
|
||||
bdata = isc_mem_get(mctx, length);
|
||||
|
||||
isc_buffer_init(dbuf, bdata, length);
|
||||
dbuf->mctx = mctx;
|
||||
|
||||
ENSURE(ISC_BUFFER_VALID(dbuf));
|
||||
|
||||
dbuf->mctx = mctx;
|
||||
|
||||
*dynbuffer = dbuf;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
|
Reference in New Issue
Block a user