* requested url. may be rewritten later, so make extra room */
int url_sz = hp->requestUri().length() + Config.appendDomainLen + 5;
http->uri = (char *)xcalloc(url_sz, 1);
- xstrncpy(http->uri, hp->requestUri().rawContent(), hp->requestUri().length());
+ xstrncpy(http->uri, hp->requestUri().rawContent(), hp->requestUri().length()+1);
}
result->flags.parsed_ok = 1;
*type_id = typeId[0];
if (request) {
- SBuf path = tok.remaining().substr(0, MAX_URL);
- xstrncpy(request, path.rawContent(), path.length());
+ SBuf path = tok.remaining().substr(0, MAX_URL-1);
+ xstrncpy(request, path.rawContent(), path.length()+1);
/* convert %xx to char */
rfc1738_unescape(request);
}