openbsd-ports/www/junkbuster/patches/patch-socks4_c

31 lines
905 B
Plaintext
Raw Normal View History

$OpenBSD: patch-socks4_c,v 1.1.1.1 2001/04/19 15:46:34 lebel Exp $
--- socks4.c.orig Fri Oct 30 22:58:47 1998
+++ socks4.c Thu Apr 12 10:53:14 2001
@@ -88,7 +88,7 @@ socks4_connect(struct gateway *gw, struc
/* build a socks request for connection to the web server */
- strcpy((char *)&(c->userid), socks_userid);
+ strncpy((char *)&(c->userid), socks_userid, sizeof(cbuf)-1);
csiz = sizeof(*c) + sizeof(socks_userid) - 1;
@@ -103,7 +103,7 @@ socks4_connect(struct gateway *gw, struc
errno = EINVAL;
return(-1);
}
- strcpy(((char *)cbuf) + csiz, http->host);
+ strncpy(((char *)cbuf) + csiz, http->host, sizeof(cbuf)-1);
csiz = n;
break;
}
@@ -162,7 +162,7 @@ socks4_connect(struct gateway *gw, struc
default:
errstr = (char *) cbuf;
errno = ENOENT;
- sprintf(errstr,
+ snprintf(errstr, BUFSIZ-1,
"SOCKS request rejected for reason code %d\n", s->cd);
}