From: Willem Toorop Date: Wed, 12 Dec 2012 14:00:54 +0000 (+0000) Subject: Also anticipate the more data at the end of an ilnp64 case X-Git-Tag: release-1.6.17rc1~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30cfacec257616413e687449f590d481637b00d1;p=thirdparty%2Fldns.git Also anticipate the more data at the end of an ilnp64 case --- diff --git a/str2host.c b/str2host.c index 399974b1..a60030e3 100644 --- a/str2host.c +++ b/str2host.c @@ -1323,9 +1323,12 @@ ldns_str2rdf_ilnp64(ldns_rdf **rd, const char *str) { unsigned int a, b, c, d; uint16_t shorts[4]; + int l; - if (sscanf(str, "%4x:%4x:%4x:%4x", &a, &b, &c, &d) != 4 || - strpbrk(str, "+-") /* no signs */) { + if (sscanf(str, "%4x:%4x:%4x:%4x%n", &a, &b, &c, &d, &l) != 4 || + l != (int)strlen(str) || /* more data to read */ + strpbrk(str, "+-") /* signed hexes */ + ) { return LDNS_STATUS_INVALID_ILNP64; } else { shorts[0] = htons(a);