Am 27.05.2022 um 23:11 schrieb Christopher Schultz:
Rainer,

On 5/27/22 4:45 PM, Rainer Jung wrote:
Hi there,

I suspect there is a ponter deref typo in the source code of the ISAPI redirector. Suggested patch would be:

diff --git a/native/iis/jk_isapi_plugin.c b/native/iis/jk_isapi_plugin.c
index c0d7a4353..4978a0b85 100644
--- a/native/iis/jk_isapi_plugin.c
+++ b/native/iis/jk_isapi_plugin.c
@@ -1886,7 +1886,7 @@ static DWORD handle_notify_event(PHTTP_FILTER_CONTEXT pfc,
           * that the extension proc will be called.
           * This allows the servlet to handle 'Translate: f'.
           */
-        if (translate && &translate) {
+        if (translate && *translate) {
              if (!pfp->AddHeader(pfc, TOMCAT_TRANSLATE_HEADER_NAME, translate)) {
                  jk_log(logger, JK_LOG_ERROR,
                         "error while adding Tomcat-Translate headers");

I think what was intended was checking, that translate is neither NULL nor an empty string. The curent check for &translate would check the address of translate instead of the first character.

WDYT?

I agree with your assessment. I can't imagine ever using "&var" in a predicate making any sense.

If you are going to change the code, I think you should explicitly compare against NULL and then also explicitly-compare the character at "translate" with \0 or your preferred spelling of the NULL-terminator. That will make it entirely clear what the predicate is doing.

Done.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to