svn commit: samba r25195 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

jra at samba.org jra at samba.org
Mon Sep 17 10:51:01 GMT 2007


Author: jra
Date: 2007-09-17 10:50:59 +0000 (Mon, 17 Sep 2007)
New Revision: 25195

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25195

Log:
Fix issue with calling pull_uc2_*alloc with
str_len == 0. We should just return 0 in this
case.
Jeremy.

Modified:
   branches/SAMBA_3_2/source/lib/charcnv.c
   branches/SAMBA_3_2_0/source/lib/charcnv.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/charcnv.c
===================================================================
--- branches/SAMBA_3_2/source/lib/charcnv.c	2007-09-17 05:31:49 UTC (rev 25194)
+++ branches/SAMBA_3_2/source/lib/charcnv.c	2007-09-17 10:50:59 UTC (rev 25195)
@@ -1369,6 +1369,10 @@
 {
 	size_t ret;
 
+	if (!src_len) {
+		return 0;
+	}
+
 	if (dest_len == (size_t)-1)
 		dest_len = sizeof(pstring);
 
@@ -1446,6 +1450,10 @@
 	}
 #endif
 
+	if (!src_len) {
+		return 0;
+	}
+
 	if (ucs2_align(base_ptr, src, flags)) {
 		src = (const void *)((const char *)src + 1);
 		if (src_len != (size_t)-1)

Modified: branches/SAMBA_3_2_0/source/lib/charcnv.c
===================================================================
--- branches/SAMBA_3_2_0/source/lib/charcnv.c	2007-09-17 05:31:49 UTC (rev 25194)
+++ branches/SAMBA_3_2_0/source/lib/charcnv.c	2007-09-17 10:50:59 UTC (rev 25195)
@@ -1369,6 +1369,10 @@
 {
 	size_t ret;
 
+	if (!src_len) {
+		return 0;
+	}
+
 	if (dest_len == (size_t)-1)
 		dest_len = sizeof(pstring);
 
@@ -1446,6 +1450,10 @@
 	}
 #endif
 
+	if (!src_len) {
+		return 0;
+	}
+
 	if (ucs2_align(base_ptr, src, flags)) {
 		src = (const void *)((const char *)src + 1);
 		if (src_len != (size_t)-1)



More information about the samba-cvs mailing list