Michal Karm Babacek created MODCLUSTER-626:
----------------------------------------------
Summary: Automatically allocated function local variable address overwrites
function parameter
Key: MODCLUSTER-626
URL:
https://issues.jboss.org/browse/MODCLUSTER-626
Project: mod_cluster
Issue Type: Bug
Components: Native (httpd modules)
Affects Versions: 1.3.7.Final, 2.0.0.Alpha1
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_c...]:
(error) Address of local auto-variable assigned to a function parameter.
*
[
native/mod_manager/node.c:227|https://github.com/modcluster/mod_proxy_clu...]:
(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)