From eaec3e46387c77dd2e7a490d116fe753dab6021d Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 15 Sep 2026 07:36:27 +0200 Subject: [PATCH] BUG/MINOR: tools: Don't try to anonymize a NULL string hash_anon() function is used to anonymize a string. It is called at several places (via HA_ANON_* macros), especially from debugging functions. It is hard to be sure the string to hash is always defined. So let's return immediately if it is NULL. Among other things, this fix avoids to get a crash when the server name created by a LUA CO-SOCKET is anonymized. Indeed, this server is created with no name. This patch should fix the issue #3491. It must be backported as far as 2.8. --- src/tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools.c b/src/tools.c index 62fd2bdcf..50e78389a 100644 --- a/src/tools.c +++ b/src/tools.c @@ -7423,7 +7423,7 @@ const char *hash_anon(uint32_t scramble, const char *string2hash, const char *pr index_hash = 0; /* don't hash empty strings */ - if (!string2hash[0] || (string2hash[0] == ' ' && string2hash[1] == 0)) + if (!string2hash || !string2hash[0] || (string2hash[0] == ' ' && string2hash[1] == 0)) return string2hash; if (scramble != 0) { -- 2.47.3