fix types used in SOCKS4/5 support code

the line

    len = buff[0]; /* max = 255 */

could lead to a negative length if the value in buff[0] is > 127.
This commit is contained in:
rofl0r authored and rofl0r committed 2018-02-06 16:11:39 +00:00
1 parent 8906b0734e
commit 7a3fd81a8d
1 file changed
+2 -2
+2 -2
View File
@@ -1270,8 +1270,8 @@ static void relay_connection (struct conn_s *connptr)
static int static int
connect_to_upstream_proxy(struct conn_s *connptr, struct request_s *request) connect_to_upstream_proxy(struct conn_s *connptr, struct request_s *request)
{ {
int len; unsigned len;
char buff[512]; /* won't use more than 7 + 255 */ unsigned char buff[512]; /* won't use more than 7 + 255 */
unsigned short port; unsigned short port;
struct hostent *host; struct hostent *host;
struct upstream *cur_upstream = connptr->upstream_proxy; struct upstream *cur_upstream = connptr->upstream_proxy;