From de24aa05c1376811be9f7f3c9a3f8c1fea14f13e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 6 Sep 2013 22:36:36 +0000 Subject: [PATCH] net: Fix parse_url(). Does not correctly parse host, if given array has no extra space. --- net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net.c b/net.c index e9b5ed1c..caf84c90 100644 --- a/net.c +++ b/net.c @@ -168,16 +168,16 @@ char *parse_url(const char *url, if (*o++ != ']' || (*o != '\0' && *o != ':')) goto failed; } else { - for (; (*c = *o == ':'? '\0' : *o); c++, o++) - if (c == end) + for (; (*c = *o == ':'? '\0' : *o); c++, o++) { + if (c == end && o[1]) goto failed; + } } if (*o == ':') if (para_atoi32(++o, port) < 0 || *port < 0 || *port > 0xffff) goto failed; - if (host_string_ok(host)) return host; failed: -- 2.39.2