From: Volker Lendecke Date: Tue, 6 Jan 2026 15:29:30 +0000 (+0100) Subject: lib: Delay get_iconv_handle() in strchr_m() X-Git-Tag: tdb-1.4.15~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12c502041cdfc3fc3585749704e4677663572702;p=thirdparty%2Fsamba.git lib: Delay get_iconv_handle() in strchr_m() Do it the same way as in strrchr_m() Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Tue Jan 20 12:56:27 UTC 2026 on atb-devel-224 --- diff --git a/lib/util/charset/util_str.c b/lib/util/charset/util_str.c index c52b77384ce..4c243e6976a 100644 --- a/lib/util/charset/util_str.c +++ b/lib/util/charset/util_str.c @@ -360,7 +360,7 @@ _PUBLIC_ size_t strlen_m_term_null(const char *s) _PUBLIC_ char *strchr_m(const char *src, char c) { const char *s; - struct smb_iconv_handle *ic = get_iconv_handle(); + struct smb_iconv_handle *ic = NULL; if (src == NULL) { return NULL; } @@ -388,6 +388,8 @@ _PUBLIC_ char *strchr_m(const char *src, char c) s = src; #endif + ic = get_iconv_handle(); + while (*s) { size_t size; codepoint_t c2 = next_codepoint_handle(ic, s, &size);