[mod_cluster-issues] [JBoss JIRA] (MODCLUSTER-625) Automatically allocated function local variable address overwrires function parameter

Michal Karm Babacek (JIRA) issues at jboss.org
Mon Oct 16 10:47:00 EDT 2017


Michal Karm Babacek created MODCLUSTER-625:
----------------------------------------------

             Summary: Automatically allocated function local variable address overwrires function parameter
                 Key: MODCLUSTER-625
                 URL: https://issues.jboss.org/browse/MODCLUSTER-625
             Project: mod_cluster
          Issue Type: Bug
          Components: Native (httpd modules)
         Environment: C99 (apparently both GNU and MSVC)
            Reporter: Michal Karm Babacek
            Assignee: George Zaronikas
             Fix For: 2.0.0.Alpha1


I went through the cppcheck static analysis report on the current mod_proxy_cluster code base, see [cppcheck.log|https://ci.modcluster.io/job/mod_proxy_cluster-2.x-windows/DISTRO=apache-lounge,label=w2k12r2/93/artifact/cppcheck.log/*view*/], and among *many* warnings and style check failures, there was a one outstanding error reported, which set me wondering.

The error occurs on two places and I'm scratching my head as to whether is is a false positive or not, WDYT?

* [native/mod_manager/domain.c:198|https://github.com/modcluster/mod_proxy_cluster/blob/master/native/mod_manager/domain.c#L198]: (error) Address of local auto-variable assigned to a function parameter.

* [native/mod_manager/node.c:227|https://github.com/modcluster/mod_proxy_cluster/blob/master/native/mod_manager/node.c#L227]: (error) Address of local auto-variable assigned to a function parameter.

Is it O.K. to handle local, function scope, automatically allocated variable this way? To use it's address later in ap_slotmem_do? Couldn't it trigger undefined behaviour and cause some of our rare, hard to reproduce crashes?

Feel free to pick up any other pertinent messages from the log.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the mod_cluster-issues mailing list