You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2014/04/25 09:31:30 UTC

[Bug 56457] New: mod_proxy_html.c: 2 * cut'n'paste errors

https://issues.apache.org/bugzilla/show_bug.cgi?id=56457

            Bug ID: 56457
           Summary: mod_proxy_html.c: 2 * cut'n'paste errors
           Product: Apache httpd-2
           Version: 2.4.9
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_filter
          Assignee: bugs@httpd.apache.org
          Reporter: dcb314@hotmail.com

[mod_proxy_html.c:326]: (style) Expression is always false because 'else if'
condition matches previous condition at line 320.

Source code is

    if ((ctx->cfg->doctype == fpi_html) || (ctx->cfg->doctype == fpi_xhtml)) {
        /* enforce html */
        if (!desc || desc->depr)
            return;

    }
    else if ((ctx->cfg->doctype == fpi_html)
             || (ctx->cfg->doctype == fpi_xhtml)) {
        /* enforce html legacy */
        if (!desc)
            return;
    }

[mod_proxy_html.c:379]: (style) Expression is always false because 'else if'
condition matches previous condition at line 372.

    if ((ctx->cfg->doctype == fpi_html) || (ctx->cfg->doctype == fpi_xhtml)) {
        /* enforce html */
        enforce = 2;
        if (!desc || desc->depr)
            return;

    }
    else if ((ctx->cfg->doctype == fpi_html)
             || (ctx->cfg->doctype == fpi_xhtml)) {
        enforce = 1;
        /* enforce html legacy */
        if (!desc) {
            return;
        }
    }

I got these two bugs from cppcheck, a static analysis tool.
It found many other things wrong.

I think apache would benefit from meeting cppcheck.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 56457] mod_proxy_html.c: 2 * cut'n'paste errors

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56457

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #1 from Christophe JAILLET <ch...@wanadoo.fr> ---
Hi and thanks for the report.

We are aware of cppcheck and I run it from time to time.

If you have spotted and confirmed specific issues, please, let us know, so that
we can fix them.


Concerning the one you have reported here, it has been fixed on trunk in
r1442409, but has not been integrated into 2.4.x branch yet.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org