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 2012/12/09 14:33:30 UTC

svn commit: r1418945 - in /httpd/httpd/branches/2.4.x: ./ STATUS modules/aaa/mod_authz_dbd.c modules/aaa/mod_authz_groupfile.c modules/dav/main/util.c modules/filters/mod_filter.c modules/mappers/mod_imagemap.c modules/mappers/mod_negotiation.c

Author: sf
Date: Sun Dec  9 13:33:29 2012
New Revision: 1418945

URL: http://svn.apache.org/viewvc?rev=1418945&view=rev
Log:
Merge r1398970, r1407853, r1398480, r1398478, r1411862, r1397320:

    1398970: Use 'ap_strcasestr' instead of a strdup/str_tolower/strstr sequence
    1407853: cppCheck:  Suspicious condition.
    1398480: cppcheck: arrayIndexThenCheck - change the order of the tests in
             order to avoid a potential out-of-bound access.
    1398478: ccpcheck: duplicateExpression - 'vary_by_language' is tested twice
    1411862: Use apr_is_empty_table() instead of getting a table and checking the
             value of the 'nelts' field.
    1397320: remove extra ';'

Submitted by: jailletc36
Reviewed by: jailletc36, minfrin, sf

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_dbd.c
    httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_groupfile.c
    httpd/httpd/branches/2.4.x/modules/dav/main/util.c
    httpd/httpd/branches/2.4.x/modules/filters/mod_filter.c
    httpd/httpd/branches/2.4.x/modules/mappers/mod_imagemap.c
    httpd/httpd/branches/2.4.x/modules/mappers/mod_negotiation.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1397320,1398478,1398480,1398970,1407853,1411862

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1418945&r1=1418944&r2=1418945&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Sun Dec  9 13:33:29 2012
@@ -91,24 +91,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * (2/x) backport some easy patch to keep 2.4.x in line with trunk as much as possible
-         1398970: Use 'ap_strcasestr' instead of a strdup/str_tolower/strstr sequence
-         1407853: cppCheck:  Suspicious condition.
-         1398480: cppcheck: arrayIndexThenCheck - change the order of the tests in
-                  order to avoid a potential out-of-bound access.
-         1398478: ccpcheck: duplicateExpression - 'vary_by_language' is tested twice
-         1411862: Use apr_is_empty_table() instead of getting a table and checking the
-                  value of the 'nelts' field.
-         1397320: remove extra ';'
-      trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1398970
-                   http://svn.apache.org/viewvc?view=revision&revision=1407853
-                   http://svn.apache.org/viewvc?view=revision&revision=1398480
-                   http://svn.apache.org/viewvc?view=revision&revision=1398478
-                   http://svn.apache.org/viewvc?view=revision&revision=1411862
-                   http://svn.apache.org/viewvc?view=revision&revision=1397320
-       2.4.c patch: http://people.apache.org/~jailletc36/backport2.patch
-       +1: jailletc36, minfrin, sf
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

Modified: httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_dbd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_dbd.c?rev=1418945&r1=1418944&r2=1418945&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_dbd.c (original)
+++ httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_dbd.c Sun Dec  9 13:33:29 2012
@@ -163,7 +163,7 @@ static int authz_dbd_login(request_rec *
             /* OK, this is non-critical; we can just not-redirect */
         }
         else if ((rv = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle,
-                                        &res, query, 0, r->user, NULL) == 0)) {
+                                        &res, query, 0, r->user, NULL)) == 0) {
             for (rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1);
                  rv != -1;
                  rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1)) {

Modified: httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_groupfile.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_groupfile.c?rev=1418945&r1=1418944&r2=1418945&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_groupfile.c (original)
+++ httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_groupfile.c Sun Dec  9 13:33:29 2012
@@ -176,7 +176,7 @@ static authz_status group_check_authoriz
         return AUTHZ_DENIED;
     }
 
-    if (apr_table_elts(grpstatus)->nelts == 0) {
+    if (apr_is_empty_table(grpstatus)) {
         /* no groups available, so exit immediately */
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01666)
                       "Authorization of user %s to access %s failed, reason: "
@@ -235,7 +235,7 @@ static authz_status filegroup_check_auth
         return AUTHZ_DENIED;
     }
 
-    if (apr_table_elts(grpstatus)->nelts == 0) {
+    if (apr_is_empty_table(grpstatus)) {
         /* no groups available, so exit immediately */
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01670)
                         "Authorization of user %s to access %s failed, reason: "

Modified: httpd/httpd/branches/2.4.x/modules/dav/main/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/dav/main/util.c?rev=1418945&r1=1418944&r2=1418945&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/dav/main/util.c (original)
+++ httpd/httpd/branches/2.4.x/modules/dav/main/util.c Sun Dec  9 13:33:29 2012
@@ -1578,7 +1578,7 @@ DAV_DECLARE(dav_error *) dav_validate_re
 
         err = (*repos_hooks->walk)(&ctx.w, DAV_INFINITY, &multi_status);
         if (err == NULL) {
-            *response = multi_status;;
+            *response = multi_status;
         }
         /* else: implies a 5xx status code occurred. */
     }

Modified: httpd/httpd/branches/2.4.x/modules/filters/mod_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/filters/mod_filter.c?rev=1418945&r1=1418944&r2=1418945&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/filters/mod_filter.c (original)
+++ httpd/httpd/branches/2.4.x/modules/filters/mod_filter.c Sun Dec  9 13:33:29 2012
@@ -221,9 +221,7 @@ static int filter_lookup(ap_filter_t *f,
                     const char *str = apr_table_get(r->headers_out,
                                                     "Cache-Control");
                     if (str) {
-                        char *str1 = apr_pstrdup(r->pool, str);
-                        ap_str_tolower(str1);
-                        if (strstr(str1, "no-transform")) {
+                        if (ap_strcasestr(str, "no-transform")) {
                             /* can't use this provider; try next */
                             continue;
                         }
@@ -278,7 +276,6 @@ static apr_status_t filter_harness(ap_fi
     apr_status_t ret;
 #ifndef NO_PROTOCOL
     const char *cachecontrol;
-    char *str;
 #endif
     harness_ctx *ctx = f->ctx;
     ap_filter_rec_t *filter = f->frec;
@@ -304,9 +301,7 @@ static apr_status_t filter_harness(ap_fi
                 cachecontrol = apr_table_get(f->r->headers_out,
                                              "Cache-Control");
                 if (cachecontrol) {
-                    str = apr_pstrdup(f->r->pool,  cachecontrol);
-                    ap_str_tolower(str);
-                    if (strstr(str, "no-transform")) {
+                    if (ap_strcasestr(cachecontrol, "no-transform")) {
                         ap_remove_output_filter(f);
                         return ap_pass_brigade(f->next, bb);
                     }

Modified: httpd/httpd/branches/2.4.x/modules/mappers/mod_imagemap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/mappers/mod_imagemap.c?rev=1418945&r1=1418944&r2=1418945&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/mappers/mod_imagemap.c (original)
+++ httpd/httpd/branches/2.4.x/modules/mappers/mod_imagemap.c Sun Dec  9 13:33:29 2012
@@ -176,7 +176,7 @@ static int pointinpoly(const double poin
     int i, numverts, crossings = 0;
     double x = point[X], y = point[Y];
 
-    for (numverts = 0; pgon[numverts][X] != -1 && numverts < MAXVERTS;
+    for (numverts = 0; numverts < MAXVERTS && pgon[numverts][X] != -1;
         numverts++) {
         /* just counting the vertexes */
     }

Modified: httpd/httpd/branches/2.4.x/modules/mappers/mod_negotiation.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/mappers/mod_negotiation.c?rev=1418945&r1=1418944&r2=1418945&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/mappers/mod_negotiation.c (original)
+++ httpd/httpd/branches/2.4.x/modules/mappers/mod_negotiation.c Sun Dec  9 13:33:29 2012
@@ -2606,7 +2606,7 @@ static void set_neg_headers(request_rec 
     }
 
     if (neg->is_transparent || vary_by_type || vary_by_language ||
-        vary_by_language || vary_by_charset || vary_by_encoding) {
+        vary_by_charset || vary_by_encoding) {
 
         apr_table_mergen(hdrs, "Vary", 2 + apr_pstrcat(r->pool,
             neg->is_transparent ? ", negotiate"       : "",