From 95d80a19f8500876972806ed672332b4249bf3e4 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 26 Sep 2014 10:59:00 +0000 Subject: [PATCH] Merge r1619297, r1621806 from trunk: Missing va_end spotted by cppcheck Silent some cppcheck warnings. Submitted by: jailletc36 Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1627747 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 7 ------- modules/mappers/mod_negotiation.c | 2 +- modules/proxy/mod_proxy_wstunnel.c | 2 +- server/util_ebcdic.c | 4 +++- server/util_expr_eval.c | 4 +--- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/STATUS b/STATUS index 1b22beb3e7f..477c0511ddb 100644 --- a/STATUS +++ b/STATUS @@ -102,13 +102,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * core: Add missing va_end spotted by cppcheck - various: Silent some cppcheck warnings - trunk patch: http://svn.apache.org/r1619297 - http://svn.apache.org/r1621806 - 2.4.x patch: trunk works (except for mod_journald which is not part of 2.4.x) - +1: jailletc36, jim, ylavic - * mod_cache: CVE-2014-3581 - Avoid a crash when Content-Type has an empty value. PR56924. trunk patch: http://svn.apache.org/r1624234 diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 5ec0d4d02de..0089a6c91cf 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -1707,7 +1707,7 @@ static void set_language_quality(negotiation_state *neg, var_rec *variant) * we are allowed to use the prefix of in HTTP/1.1 */ char *lang = ((char **) (variant->content_languages->elts))[j]; - int idx = -1; + int idx; /* If we wish to fallback or * we use our own LanguagePriority index. diff --git a/modules/proxy/mod_proxy_wstunnel.c b/modules/proxy/mod_proxy_wstunnel.c index c30c4aa73c6..6013549ac66 100644 --- a/modules/proxy/mod_proxy_wstunnel.c +++ b/modules/proxy/mod_proxy_wstunnel.c @@ -151,7 +151,7 @@ static int ap_proxy_wstunnel_request(apr_pool_t *p, request_rec *r, apr_uri_t *uri, char *url, char *server_portstr) { - apr_status_t rv = APR_SUCCESS; + apr_status_t rv; apr_pollset_t *pollset; apr_pollfd_t pollfd; const apr_pollfd_t *signalled; diff --git a/server/util_ebcdic.c b/server/util_ebcdic.c index 7faae794de9..dc13706465a 100644 --- a/server/util_ebcdic.c +++ b/server/util_ebcdic.c @@ -104,8 +104,10 @@ int ap_rvputs_proto_in_ascii(request_rec *r, ...) len = strlen(s); ascii_s = apr_pstrmemdup(r->pool, s, len); ap_xlate_proto_to_ascii(ascii_s, len); - if (ap_rputs(ascii_s, r) < 0) + if (ap_rputs(ascii_s, r) < 0) { + va_end(va); return -1; + } written += len; } va_end(va); diff --git a/server/util_expr_eval.c b/server/util_expr_eval.c index 0c4ba1fd406..bb427d17530 100644 --- a/server/util_expr_eval.c +++ b/server/util_expr_eval.c @@ -236,10 +236,8 @@ static int ap_expr_eval_comp(ap_expr_eval_ctx_t *ctx, const ap_expr_t *node) do { const ap_expr_t *val = e2->node_arg1; AP_DEBUG_ASSERT(e2->node_op == op_ListElement); - if (strcmp(needle, ap_expr_eval_word(ctx, val)) == 0) { + if (strcmp(needle, ap_expr_eval_word(ctx, val)) == 0) return 1; - break; - } e2 = e2->node_arg2; } while (e2 != NULL); } -- 2.47.2