Bug 47867

Summary: IIS connector compiled with VS2008 crashes, when worker contains unsupported properties
Product: Tomcat Connectors Reporter: Indrek Juhani <indrek.juhani>
Component: CommonAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: 1.2.26   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   
Attachments: Patch terminates native/common/jk_util.c:supported_properties array with NULL

Description Indrek Juhani 2009-09-18 01:28:12 UTC
Created attachment 24289 [details]
Patch terminates native/common/jk_util.c:supported_properties array with NULL

The 1.2.26 was re-compiled with VS2008. The workers file contained accidentally
a worker property introduced by 1.2.27. The IIS connector crashes during
initialization with memory access error.

The problem is, that native/common/jk_util.c:supported_properties array does
not end with NULL. In case of wrong property, the pointer will go out of bounds
in
native/common/jk_util.c:jk_is_valid_property function.

The officail binary release DLL of 1.2.26 from Apache will print:

[error] jk_map.c (403): The attribute 'worker.gw1.ping_mode' is not supported -
please check the documentation for the supported attributes.

and does not cause crash. This could be because VC++ 6.0 (which is used for
official binary builds as I understand) uses different memory alignment/layout
or something else. Anyway, I think it is safer not to permit run pointer out of
array and explicitly mark the end of list with NULL.

Proposed fix is attached as patch.
Comment 1 Rainer Jung 2009-09-18 05:17:21 UTC
Thanks for the analysis and patch.
It has been applied to 1.2.x as revision 816596 and will be part of 1.2.29.
Sorry for the inconvenience.