Procrun intermittently fails to set string values to the registry
-----------------------------------------------------------------

                 Key: DAEMON-167
                 URL: https://issues.apache.org/jira/browse/DAEMON-167
             Project: Commons Daemon
          Issue Type: Bug
          Components: Procrun
    Affects Versions: Nightly Builds
         Environment: Windows Server 2008 SP2 JPN (but I don't think the 
versions matter)
            Reporter: Kamishima, Kiyoshi


Due to an incorrect use of Win32 Registry APIs, Procrun intermittently fails to 
set string values to the registry and ends up failing to start itself up.

As described in the following API reference page, cbData passed to 
RegSetValueEx function must include the size of the terminating null character.
http://msdn.microsoft.com/en-us/library/ms724923.aspx

However, apxRegistrySetStrA() and apxRegistrySetStrW() functions in Procrun 
codebase apparently neglect it.
http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/procrun/src/registry.c?revision=779922&view=markup

In most cases, these off-by-one error is automatically compensated somewhere 
between API entry and the kernel, so the error is not apparent. But I have 
actually seen a case that the resulted registry value lacked the terminating 
null character and prevented the service from starting.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to