1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

Cure size_t abuse, curse some recent code [recommit good bits from r1227852]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1227856 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William A. Rowe Jr
2012-01-05 21:50:31 +00:00
parent 07e32f24db
commit 33d94f3328
3 changed files with 9 additions and 6 deletions

View File

@@ -78,13 +78,15 @@ APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, create_req,
(request_rec *r, request_rec *pr), (r, pr),
OK, DECLINED)
PROXY_DECLARE(apr_status_t) ap_proxy_strncpy(char *dst, const char *src, size_t dlen)
PROXY_DECLARE(apr_status_t) ap_proxy_strncpy(char *dst, const char *src,
apr_size_t dlen)
{
if ((strlen(src)+1) > dlen) {
/* APR_ENOSPACE would be better */
/* XXX: APR_ENOSPACE would be better */
return APR_EGENERAL;
}
else {
/* XXX: Once slen and dlen are known, no excuse not to memcpy */
apr_cpystrn(dst, src, dlen);
}
return APR_SUCCESS;
@@ -921,14 +923,14 @@ PROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r,
proxy_req_conf *rconf = ap_get_module_config(r->request_config,
&proxy_module);
struct proxy_alias *ent;
size_t len = strlen(str);
apr_size_t len = strlen(str);
const char *newpath = NULL;
const char *newdomain = NULL;
const char *pathp;
const char *domainp;
const char *pathe = NULL;
const char *domaine = NULL;
size_t l1, l2, poffs = 0, doffs = 0;
apr_size_t l1, l2, poffs = 0, doffs = 0;
int i;
int ddiff = 0;
int pdiff = 0;