/*
- * $Id: url.cc,v 1.29 1996/08/12 23:37:25 wessels Exp $
+ * $Id: url.cc,v 1.30 1996/08/27 17:55:34 wessels Exp $
*
* DEBUG: section 23 URL Parsing
* AUTHOR: Duane Wessels
char *t = NULL;
int port;
protocol_t protocol = PROTO_NONE;
+ int l;
proto[0] = host[0] = urlpath[0] = login[0] = '\0';
- if (strlen(url) > MAX_URL) {
- debug(23, 0, "urlParse: URL too large (%d bytes)\n", strlen(url));
+ if ((l = strlen(url)) > MAX_URL) {
+ /* terminate so it doesn't overflow other buffers */
+ *(url + (MAX_URL >> 1)) = '\0';
+ debug(23, 0, "urlParse: URL too large (%d bytes)\n", l);
return NULL;
}
if (method == METHOD_CONNECT) {