From: Willem Toorop Date: Thu, 25 Aug 2011 11:02:12 +0000 (+0000) Subject: Make parsing APL strings more robust (not crashing if an ':' or '/' character is... X-Git-Tag: release-1.6.11rc1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13b684a821cbfe15dd84dffd55b27845e4cac34a;p=thirdparty%2Fldns.git Make parsing APL strings more robust (not crashing if an ':' or '/' character is not present). See bug #404 --- diff --git a/str2host.c b/str2host.c index 2eda2f80..4ec9d379 100644 --- a/str2host.c +++ b/str2host.c @@ -460,7 +460,10 @@ ldns_str2rdf_apl(ldns_rdf **rd, const char *str) size_t i = 0; /* [!]afi:address/prefix */ - if (strlen(my_str) < 2) { + if (strlen(my_str) < 2 + || strchr(my_str, ':') == NULL + || strchr(my_str, '/') == NULL + || strchr(my_str, ':') > strchr(my_str, '/')) { return LDNS_STATUS_INVALID_STR; }