From ba0224644b119e27fe04a8e641247a9454ca9b57 Mon Sep 17 00:00:00 2001 From: thatcher thornberry Date: Thu, 18 Jul 2024 10:32:49 -0600 Subject: [PATCH] logging bug --- src/ngx_http_ssl_ja4_module.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ngx_http_ssl_ja4_module.h b/src/ngx_http_ssl_ja4_module.h index 12f2c16..51ce2fc 100644 --- a/src/ngx_http_ssl_ja4_module.h +++ b/src/ngx_http_ssl_ja4_module.h @@ -354,10 +354,19 @@ ngx_ssl_ja4_detail_print(ngx_pool_t *pool, ngx_ssl_ja4_t *ja4) } /* ALPN Values */ - ngx_log_debug1(NGX_LOG_DEBUG_EVENT, - pool->log, 0, "ssl_ja4: ALPN Value: %s\n", - ja4->alpn_first_value); -} + // handle if null + if (ja4->alpn_first_value == NULL) + { + ngx_log_debug1(NGX_LOG_DEBUG_EVENT, + pool->log, 0, "ssl_ja4: ALPN Value: NULL\n"); + } + else + { + ngx_log_debug1(NGX_LOG_DEBUG_EVENT, + pool->log, 0, "ssl_ja4: ALPN Value: %s\n", + ja4->alpn_first_value); + } + #endif // FUNCTION PROTOTYPES