From 30cfacec257616413e687449f590d481637b00d1 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 12 Dec 2012 14:00:54 +0000 Subject: [PATCH] Also anticipate the more data at the end of an ilnp64 case --- str2host.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); -- 2.47.3