From: Miek Gieben Date: Thu, 2 Mar 2006 14:45:39 +0000 (+0000) Subject: check for overlong labels X-Git-Tag: release-1.1.0~330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b75b5e7d7efa71e7c3798a1e4e0044ba40147ad;p=thirdparty%2Fldns.git check for overlong labels --- diff --git a/wire2host.c b/wire2host.c index f4c8766e..ab0b8753 100644 --- a/wire2host.c +++ b/wire2host.c @@ -111,6 +111,11 @@ ldns_wire2dname(ldns_rdf **dname, const uint8_t *wire, size_t max, size_t *pos) uncompressed_length += label_size + 1; dname_pos += label_size; *pos = *pos + label_size; + + if (dname_pos > LDNS_MAX_DOMAINLEN) { + return LDNS_STATUS_DOMAINNAME_OVERFLOW; + } + if (*pos < max) { label_size = wire[*pos]; }