mirror of
https://github.com/samba-team/samba.git
synced 2025-11-28 12:23:49 +03:00
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 commit is contained in:
committed by
Gerald (Jerry) Carter
parent
0acf95d84c
commit
2a6f59f376
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user