summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-12 06:12:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:49 -0500
commit94c18cd1a3399a621f6191e16e925e18bf641707 (patch)
tree31cf998757d9a2153d54397648f436b80ae462e1
parent2ec58445cac6152a652024372d367fc23d4770da (diff)
downloadsamba-94c18cd1a3399a621f6191e16e925e18bf641707.tar.gz
samba-94c18cd1a3399a621f6191e16e925e18bf641707.tar.bz2
samba-94c18cd1a3399a621f6191e16e925e18bf641707.zip
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)
-rw-r--r--source4/lib/util_str.c4
1 files changed, 4 insertions, 0 deletions
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;