svn commit: samba r22019 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_25/source/lib

vlendec at samba.org vlendec at samba.org
Sun Apr 1 13:50:03 GMT 2007


Author: vlendec
Date: 2007-04-01 13:50:02 +0000 (Sun, 01 Apr 2007)
New Revision: 22019

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

Log:
Jeremy, this hopefully fixes the build farm currently. But I think we need
another get_safe_offset call that also includes the required buffer size.

Volker

Modified:
   branches/SAMBA_3_0/source/lib/util.c
   branches/SAMBA_3_0_25/source/lib/util.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util.c	2007-03-31 03:11:02 UTC (rev 22018)
+++ branches/SAMBA_3_0/source/lib/util.c	2007-04-01 13:50:02 UTC (rev 22019)
@@ -3132,7 +3132,7 @@
 char *get_safe_offset(const char *buf_base, size_t buf_len, char *ptr, size_t off)
 {
 	const char *end_base = buf_base + buf_len;
-	const char *end_ptr = ptr + off;
+	char *end_ptr = ptr + off;
 
 	if (!buf_base || !ptr) {
 		return NULL;
@@ -3143,7 +3143,7 @@
 	}
 
 	if (end_ptr < end_base) {
-		return ptr;
+		return end_ptr;
 	}
 	return NULL;
 }

Modified: branches/SAMBA_3_0_25/source/lib/util.c
===================================================================
--- branches/SAMBA_3_0_25/source/lib/util.c	2007-03-31 03:11:02 UTC (rev 22018)
+++ branches/SAMBA_3_0_25/source/lib/util.c	2007-04-01 13:50:02 UTC (rev 22019)
@@ -3120,7 +3120,7 @@
 char *get_safe_offset(const char *buf_base, size_t buf_len, char *ptr, size_t off)
 {
 	const char *end_base = buf_base + buf_len;
-	const char *end_ptr = ptr + off;
+	char *end_ptr = ptr + off;
 
 	if (!buf_base || !ptr) {
 		return NULL;
@@ -3131,7 +3131,7 @@
 	}
 
 	if (end_ptr < end_base) {
-		return ptr;
+		return end_ptr;
 	}
 	return NULL;
 }



More information about the samba-cvs mailing list