--------------------- PatchSet 12597 Date: 2010/01/15 11:40:30 Author: amosjeffries Branch: HEAD Tag: (none) Log: Handle DNS header-only packets as invalid. Members: lib/rfc1035.c:1.30->1.31 Index: squid/lib/rfc1035.c =================================================================== RCS file: /cvsroot/squid/squid/lib/rfc1035.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- squid/lib/rfc1035.c 15 Jun 2008 03:49:55 -0000 1.30 +++ squid/lib/rfc1035.c 15 Jan 2010 11:40:30 -0000 1.31 @@ -1,6 +1,6 @@ /* - * $Id: rfc1035.c,v 1.30 2008/06/15 03:49:55 hno Exp $ + * $Id: rfc1035.c,v 1.31 2010/01/15 11:40:30 amosjeffries Exp $ * * Low level DNS protocol routines * AUTHOR: Duane Wessels @@ -286,7 +286,9 @@ size_t len; assert(ns > 0); do { - assert((*off) < sz); + if ((*off) >= sz) { + return 1; + } c = *(buf + (*off)); if (c > 191) { /* blasted compression */