From 94c18cd1a3399a621f6191e16e925e18bf641707 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Oct 2004 06:12:24 +0000 Subject: r2932: character expansion in strlower_m or strupper_m is considered fatal (as it could cause a overflow). Print a message giving the character values involved in the expansion so it can be debugged if it happens. (This used to be commit 2a6f59f376a132fcbce8c8e9d1b38d8aae3e8561) --- source4/lib/util_str.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index 89c26e6d22..03ba1399ef 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -754,6 +754,8 @@ void strlower_m(char *s) codepoint_t c = next_codepoint(s, &c_size); c_size2 = push_codepoint(d, tolower_w(c)); if (c_size2 > c_size) { + DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strlower_m\n", + c, tolower_w(c), c_size, c_size2)); smb_panic("codepoint expansion in strlower_m\n"); } s += c_size; @@ -788,6 +790,8 @@ void strupper_m(char *s) codepoint_t c = next_codepoint(s, &c_size); c_size2 = push_codepoint(d, toupper_w(c)); if (c_size2 > c_size) { + DEBUG(0,("FATAL: codepoint 0x%x (0x%x) expanded from %d to %d bytes in strupper_m\n", + c, toupper_w(c), c_size, c_size2)); smb_panic("codepoint expansion in strupper_m\n"); } s += c_size; -- cgit