From 040eb8f07f634655312db930a81f9b0c9ce3fc15 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 7 Jul 2020 18:46:44 +1000 Subject: [PATCH 1/2] Check that handle is non-NULL before dereferencing it --- lib/dns/dnstap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index 219652479c..f107b990c9 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -895,7 +895,9 @@ dns_dt_open(const char *filename, dns_dtmode_t mode, isc_mem_t *mctx, handle = NULL; cleanup: - if (result != ISC_R_SUCCESS && handle->reader != NULL) { + if (result != ISC_R_SUCCESS && + handle != NULL && handle->reader != NULL) + { fstrm_reader_destroy(&handle->reader); handle->reader = NULL; } From ffe1a54d8f0a549325dbb08f10c75b766368bd09 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 7 Jul 2020 18:52:16 +1000 Subject: [PATCH 2/2] Add CHANGES note --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 4d1d7b637f..8a4def9270 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5463. [bug] Address potential NULL pointer dereference on out of + memory in dnstap.c. [GL #2010] + 5462. [bug] Move LMDB locking from LMDB itself to named. [GL #1976] 5458. [bug] Prevent a theoretically possible NULL dereference caused