X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_url.c;fp=php_http_url.c;h=1f06271f9527183f12c9c5c2a46506b14a674b74;hb=7205cf3cfe9e5dd142513541414b0327aa3be0cf;hp=4263aab6a068d7e961243a8608e751c3c4a7df1c;hpb=eacb6502617d4330cffe43ad57878b8902676397;p=m6w6%2Fext-http diff --git a/php_http_url.c b/php_http_url.c index 4263aab..1f06271 100644 --- a/php_http_url.c +++ b/php_http_url.c @@ -528,7 +528,7 @@ static STATUS parse_hostinfo(php_http_url_t *url, const char *ptr) case ':': if (port) { php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Failed to parse port; duplicate ':' at pos %u in '%s'", + "Failed to parse port; unexpected ':' at pos %u in '%s'", (unsigned) (ptr - tmp), tmp); return FAILURE; } @@ -625,12 +625,19 @@ static STATUS parse_hostinfo(php_http_url_t *url, const char *ptr) static const char *parse_authority(php_http_url_t *url) { - const char *tmp = url->ptr; + const char *tmp = url->ptr, *host = NULL; do { switch (*url->ptr) { case '@': /* userinfo delimiter */ + if (host) { + TSRMLS_FETCH_FROM_CTX(url->ts); + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "Failed to parse userinfo; unexpected '@'"); + return NULL; + } + host = url->ptr + 1; if (tmp != url->ptr && SUCCESS != parse_userinfo(url, tmp)) { return NULL; }