2
0
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:
Ondřej Surý
2019-09-27 11:53:49 +02:00
parent 8f2ad12d0a
commit e9f30fc211

View File

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