Browse Source

Prevent overflows of the port char array in extract_sockaddr.

Con Kolivas 13 years ago
parent
commit
9ccfcee6dc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      util.c

+ 1 - 1
util.c

@@ -832,7 +832,7 @@ bool extract_sockaddr(struct pool *pool, char *url)
 	sprintf(url_address, "%.*s", url_len, url_begin);
 
 	if (port_len)
-		sprintf(port, "%.*s", port_len, port_start);
+		snprintf(port, 5, "%.*s", port_len, port_start);
 	else
 		strcpy(port, "80");