From 7ab26a2c3296738fd96842f526858271380cce38 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 16 Dec 2007 18:55:16 +0000 Subject: [PATCH] r15519@tombo: nickm | 2007-12-16 13:54:12 -0500 Fix for bug 1846282: accept as well-formed DNS replies with questions but no answers. svn:r595 --- ChangeLog | 5 +++-- evdns.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd856a19..38b8c9da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ Changes in current version: o free minheap on event_base_free(); from Christopher Layne o debug cleanups in signal.c; from Christopher Layne - o provide event_base_new() that does not set the current_base global + o provide event_base_new() that does not set the current_base global o bufferevent_write now uses a const source argument; report from Charles Kerr o improve documentation on event_base_loopexit; patch from Scott Lamb o New function, event_{base_}loopbreak. Like event_loopexit, it makes an event loop stop executing and return. Unlike event_loopexit, it keeps subsequent pending events from getting executed. Patch from Scott Lamb @@ -26,7 +26,8 @@ Changes in current version: o prefix {encode,decode}_tag functions with evtag to avoid collisions o fix a bug with event_rpcgen for integers o restructure the code to make event activation independent of regular event logic - + o Correctly handle DNS replies with no answers set (Fixes bug 1846282) + Changes in 1.4.0: o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr. diff --git a/evdns.c b/evdns.c index bed077d2..c9d7080f 100644 --- a/evdns.c +++ b/evdns.c @@ -867,7 +867,7 @@ reply_parse(u8 *packet, int length) { */ SKIP_NAME; j += 4; - if (j >= length) goto err; + if (j > length) goto err; } /* now we have the answer section which looks like