httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r1228262 - in /httpd/httpd/branches/2.4.x: include/http_protocol.h modules/proxy/ajp_msg.c modules/proxy/mod_proxy.h modules/proxy/proxy_util.c
Date Fri, 06 Jan 2012 16:51:56 GMT
Author: wrowe
Date: Fri Jan  6 16:51:55 2012
New Revision: 1228262

URL: http://svn.apache.org/viewvc?rev=1228262&view=rev
Log:
Cure size_t abuse; Backport r1227856

Modified:
    httpd/httpd/branches/2.4.x/include/http_protocol.h
    httpd/httpd/branches/2.4.x/modules/proxy/ajp_msg.c
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h
    httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c

Modified: httpd/httpd/branches/2.4.x/include/http_protocol.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/http_protocol.h?rev=1228262&r1=1228261&r2=1228262&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/http_protocol.h (original)
+++ httpd/httpd/branches/2.4.x/include/http_protocol.h Fri Jan  6 16:51:55 2012
@@ -209,8 +209,10 @@ AP_DECLARE(apr_status_t) ap_send_fd(apr_
  * @param length The amount of data to send
  * @return The number of bytes sent
  */
-AP_DECLARE(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset,
-                             size_t length);
+AP_DECLARE(apr_size_t) ap_send_mmap(apr_mmap_t *mm,
+                                    request_rec *r,
+                                    apr_size_t offset,
+                                    apr_size_t length);
 #endif
 
 

Modified: httpd/httpd/branches/2.4.x/modules/proxy/ajp_msg.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/ajp_msg.c?rev=1228262&r1=1228261&r2=1228262&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/ajp_msg.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/ajp_msg.c Fri Jan  6 16:51:55 2012
@@ -326,7 +326,7 @@ apr_status_t ajp_msg_append_uint8(ajp_ms
 apr_status_t ajp_msg_append_string_ex(ajp_msg_t *msg, const char *value,
                                       int convert)
 {
-    size_t len;
+    apr_size_t len;
 
     if (value == NULL) {
         return(ajp_msg_append_uint16(msg, 0xFFFF));

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h?rev=1228262&r1=1228261&r2=1228262&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy.h Fri Jan  6 16:51:55 2012
@@ -522,7 +522,8 @@ APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, 
 
 /* proxy_util.c */
 
-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);
 PROXY_DECLARE(int) ap_proxy_hex2c(const char *x);
 PROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x);
 PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype
t,

Modified: httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c?rev=1228262&r1=1228261&r2=1228262&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c Fri Jan  6 16:51:55 2012
@@ -78,13 +78,15 @@ APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(prox
                                    (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_coo
     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;



Mime
View raw message