You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/06/14 22:55:59 UTC

svn commit: r954641 - in /httpd/httpd/trunk: modules/filters/mod_request.c modules/proxy/ajp_msg.c modules/proxy/mod_proxy_ftp.c modules/slotmem/mod_slotmem_shm.c modules/ssl/ssl_engine_config.c modules/ssl/ssl_util_ssl.c server/core_filters.c

Author: sf
Date: Mon Jun 14 20:55:59 2010
New Revision: 954641

URL: http://svn.apache.org/viewvc?rev=954641&view=rev
Log:
Fix some compiler warnings:
- suggest braces around empty body in an 'if' statement
- comparison of unsigned expression >= 0 is always true
- comparison of unsigned expression < 0 is always false

Please review carefully.

Modified:
    httpd/httpd/trunk/modules/filters/mod_request.c
    httpd/httpd/trunk/modules/proxy/ajp_msg.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
    httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_config.c
    httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c
    httpd/httpd/trunk/server/core_filters.c

Modified: httpd/httpd/trunk/modules/filters/mod_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_request.c?rev=954641&r1=954640&r2=954641&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_request.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_request.c Mon Jun 14 20:55:59 2010
@@ -312,13 +312,14 @@ typedef enum {
  */
 static int ap_parse_request_form(request_rec * r, ap_filter_t * f,
                                  apr_array_header_t ** ptr,
-                                 apr_size_t num, apr_size_t size)
+                                 apr_size_t num, apr_size_t usize)
 {
     apr_bucket_brigade *bb = NULL;
     int seen_eos = 0;
     char buffer[HUGE_STRING_LEN + 1];
     const char *ct;
     apr_size_t offset = 0;
+    apr_ssize_t size;
     ap_form_type_t state = FORM_NAME, percent = FORM_NORMAL;
     ap_form_pair_t *pair = NULL;
     apr_array_header_t *pairs = apr_array_make(r->pool, 4, sizeof(ap_form_pair_t));
@@ -334,6 +335,11 @@ static int ap_parse_request_form(request
         return ap_discard_request_body(r);
     }
 
+    if (usize > APR_SIZE_MAX >> 1)
+        size = APR_SIZE_MAX >> 1;
+    else
+        size = usize;
+
     if (!f) {
         f = r->input_filters;
     }

Modified: httpd/httpd/trunk/modules/proxy/ajp_msg.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/ajp_msg.c?rev=954641&r1=954640&r2=954641&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/ajp_msg.c (original)
+++ httpd/httpd/trunk/modules/proxy/ajp_msg.c Mon Jun 14 20:55:59 2010
@@ -292,8 +292,10 @@ apr_status_t ajp_msg_append_string_ex(aj
     /* We checked for space !!  */
     memcpy(msg->buf + msg->len, value, len + 1); /* including \0 */
 
-    if (convert)   /* convert from EBCDIC if needed */
+    if (convert) {
+        /* convert from EBCDIC if needed */
         ap_xlate_proto_to_ascii((char *)msg->buf + msg->len, len + 1);
+    }
 
     msg->len += len + 1;
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c?rev=954641&r1=954640&r2=954641&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Mon Jun 14 20:55:59 2010
@@ -795,8 +795,9 @@ static int ftp_set_TYPE(char xfer_type, 
                              "Unable to set transfer type");
     }
 /* Allow not implemented */
-    else if (rc == 504)
-        /* ignore it silently */;
+    else if (rc == 504) {
+        /* ignore it silently */
+    }
 
     return ret;
 }

Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=954641&r1=954640&r2=954641&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Mon Jun 14 20:55:59 2010
@@ -438,7 +438,7 @@ static apr_status_t slotmem_dptr(ap_slot
     if (!slot) {
         return APR_ENOSHMAVAIL;
     }
-    if (id < 0 || id >= slot->desc.num) {
+    if (id >= slot->desc.num) {
         return APR_ENOSHMAVAIL;
     }
 

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_config.c?rev=954641&r1=954640&r2=954641&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_config.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_config.c Mon Jun 14 20:55:59 2010
@@ -1165,12 +1165,14 @@ const char *ssl_cmd_SSLRequire(cmd_parms
 const char *ssl_cmd_SSLRenegBufferSize(cmd_parms *cmd, void *dcfg, const char *arg)
 {
     SSLDirConfigRec *dc = dcfg;
-    
-    dc->nRenegBufferSize = atoi(arg);
-    if (dc->nRenegBufferSize < 0) {
+    int val;
+
+    val = atoi(arg);
+    if (val < 0) {
         return apr_pstrcat(cmd->pool, "Invalid size for SSLRenegBufferSize: ",
                            arg, NULL);
     }
+    dc->nRenegBufferSize = val;
 
     return NULL;
 }

Modified: httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c?rev=954641&r1=954640&r2=954641&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c Mon Jun 14 20:55:59 2010
@@ -324,7 +324,7 @@ BOOL SSL_X509_getBC(X509 *cert, int *ca,
     char *cp;
 
     bc = X509_get_ext_d2i(cert, NID_basic_constraints, NULL, NULL);
-    if (bc == NULL);
+    if (bc == NULL)
         return FALSE;
     *ca = bc->ca;
     *pathlen = -1 /* unlimited */;

Modified: httpd/httpd/trunk/server/core_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core_filters.c?rev=954641&r1=954640&r2=954641&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core_filters.c (original)
+++ httpd/httpd/trunk/server/core_filters.c Mon Jun 14 20:55:59 2010
@@ -468,7 +468,7 @@ apr_status_t ap_core_output_filter(ap_fi
             non_file_bytes_in_brigade = 0;
         }
         else if (!APR_BUCKET_IS_METADATA(bucket)) {
-            if (bucket->length < 0) {
+            if (bucket->length != (apr_size_t)-1) {
                 const char *data;
                 apr_size_t length;
                 /* XXX support nonblocking read here? */