]> granicus.if.org Git - apache/commitdiff
Merge r1398970, r1407853, r1398480, r1398478, r1411862, r1397320:
authorStefan Fritsch <sf@apache.org>
Sun, 9 Dec 2012 13:33:29 +0000 (13:33 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 9 Dec 2012 13:33:29 +0000 (13:33 +0000)
    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

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1418945 13f79535-47bb-0310-9956-ffa450edef68

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

diff --git a/STATUS b/STATUS
index f11711f680f5e7578a39beca3b15cce626e39b95..b69ae2f627b24686baeaf29eaed77c55ce751082 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -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 ]
index 86d3b5612a96f7615f570d02b442a00022c0b09a..2d4925f5224f708aa04c0419983079c09a0047e1 100644 (file)
@@ -163,7 +163,7 @@ static int authz_dbd_login(request_rec *r, authz_dbd_cfg *cfg,
             /* 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)) {
index fb94168891366eb4074c8ec49cde5ed4034710b0..15bb60ffe1d359844b02bb97489679adfcead269 100644 (file)
@@ -176,7 +176,7 @@ static authz_status group_check_authorization(request_rec *r,
         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_authorization(request_rec *r,
         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: "
index d076cc45fd065bae22df34355e102ffa0a92ac1f..aa0858410295f438e23370e255c7d1fcc2165dc4 100644 (file)
@@ -1578,7 +1578,7 @@ DAV_DECLARE(dav_error *) dav_validate_request(request_rec *r,
 
         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. */
     }
index 67cfd6bbc332f4fd687b90ed48b3e736f9f1da40..ca184f85f7dfbd0bbd016296c58c6f8548eb3526 100644 (file)
@@ -221,9 +221,7 @@ static int filter_lookup(ap_filter_t *f, ap_filter_rec_t *filter)
                     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_filter_t *f, apr_bucket_brigade *bb)
     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_filter_t *f, apr_bucket_brigade *bb)
                 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);
                     }
index 9edb3e9f7e67e20d6837d5a7dbb82e0a0fcc64c6..8057e29608bd6a1d58041757610cf90e6bfea97b 100644 (file)
@@ -176,7 +176,7 @@ static int pointinpoly(const double point[2], double pgon[MAXVERTS][2])
     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 */
     }
index 5f3232b8a557c2a64c82fa855ce58b33a4c817fc..4a3a45730eeb70be23bb2ae067a44fd47af45c34 100644 (file)
@@ -2606,7 +2606,7 @@ static void set_neg_headers(request_rec *r, negotiation_state *neg,
     }
 
     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"       : "",