From 709220567fb820cf7e7625925449dadf86317629 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 7 Sep 2007 05:14:33 +0000 Subject: [PATCH] 2230. [bug] We could INSIST reading a corrupted journal. [RT #17132] --- CHANGES | 3 +++ lib/dns/journal.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 13e310869f..b74a78896c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2230. [bug] We could INSIST reading a corrupted journal. + [RT #17132] + 2229. [bug] Null pointer dereference on query pool creation failure. [RT #17133] diff --git a/lib/dns/journal.c b/lib/dns/journal.c index ee89b4f068..05b73e480b 100644 --- a/lib/dns/journal.c +++ b/lib/dns/journal.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: journal.c,v 1.98 2007/09/02 23:02:53 marka Exp $ */ +/* $Id: journal.c,v 1.99 2007/09/07 05:14:33 marka Exp $ */ #include @@ -1629,6 +1629,8 @@ read_one_rr(dns_journal_t *j) { /* * Parse the rdata. */ + if (isc_buffer_remaininglength(&j->it.source) != rdlen) + FAIL(DNS_R_FORMERR); isc_buffer_setactive(&j->it.source, rdlen); dns_rdata_reset(&j->it.rdata); CHECK(dns_rdata_fromwire(&j->it.rdata, rdclass,