Bug 47867 - IIS connector compiled with VS2008 crashes, when worker contains unsupported properties
Summary: IIS connector compiled with VS2008 crashes, when worker contains unsupported ...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: 1.2.26
Hardware: PC Windows Server 2003
: P2 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-18 01:28 UTC by Indrek Juhani
Modified: 2009-09-18 05:17 UTC (History)
0 users



Attachments
Patch terminates native/common/jk_util.c:supported_properties array with NULL (362 bytes, application/octet-stream)
2009-09-18 01:28 UTC, Indrek Juhani
Details

Note You need to log in before you can comment on or make changes to this bug.
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.