svn commit: samba r2932 - in branches/SAMBA_4_0/source/lib: .

tridge at samba.org tridge at samba.org
Tue Oct 12 06:12:24 GMT 2004


Author: tridge
Date: 2004-10-12 06:12:24 +0000 (Tue, 12 Oct 2004)
New Revision: 2932

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib&rev=2932&nolog=1

Log:
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.

Modified:
   branches/SAMBA_4_0/source/lib/util_str.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util_str.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util_str.c	2004-10-12 06:07:55 UTC (rev 2931)
+++ branches/SAMBA_4_0/source/lib/util_str.c	2004-10-12 06:12:24 UTC (rev 2932)
@@ -754,6 +754,8 @@
 		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 @@
 		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;



More information about the samba-cvs mailing list