Browse code

bb#11129 - applied unencoded '@' patch

Kevin Lin authored on 2016/06/03 00:09:55
Showing 1 changed files
... ...
@@ -1265,7 +1265,9 @@ int cli_url_canon(const char *inurl, size_t len, char *urlbuff, size_t dest_len,
1265 1265
 	++host_begin;
1266 1266
 
1267 1267
 	/* ignore username in URL */
1268
-	p = strchr(host_begin, '@');
1268
+	while((host_begin < urlend) && *host_begin == '/') ++host_begin;
1269
+	host_len = strcspn(host_begin, ":/?");
1270
+	p = memchr(host_begin, '@', host_len);
1269 1271
 	if (p)
1270 1272
 	    host_begin = p+1;
1271 1273
 	url = host_begin;