svn commit: samba r11073 - branches/SAMBA_3_0/source/registry
trunk/source/registry
jerry at samba.org
jerry at samba.org
Fri Oct 14 21:46:33 GMT 2005
Author: jerry
Date: 2005-10-14 21:46:32 +0000 (Fri, 14 Oct 2005)
New Revision: 11073
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11073
Log:
safety checks on pointers to prevent crashing when converting REG_MULTI_SZ
Modified:
branches/SAMBA_3_0/source/registry/reg_util.c
trunk/source/registry/reg_util.c
Changeset:
Modified: branches/SAMBA_3_0/source/registry/reg_util.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_util.c 2005-10-14 21:43:13 UTC (rev 11072)
+++ branches/SAMBA_3_0/source/registry/reg_util.c 2005-10-14 21:46:32 UTC (rev 11073)
@@ -137,7 +137,10 @@
uint16 *wp;
*values = NULL;
-
+
+ if ( !multi_string || !*values )
+ return 0;
+
/* just count the NULLs */
for ( i=0; (i<multi_len-1) && !(multi_string[i]==0x0 && multi_string[i+1]==0x0); i++ ) {
@@ -183,6 +186,9 @@
size_t buf_size = 0;
uint16 *buf, *b;
UNISTR2 sz;
+
+ if ( !values || !*buffer )
+ return 0;
/* go ahead and alloc some space */
Modified: trunk/source/registry/reg_util.c
===================================================================
--- trunk/source/registry/reg_util.c 2005-10-14 21:43:13 UTC (rev 11072)
+++ trunk/source/registry/reg_util.c 2005-10-14 21:46:32 UTC (rev 11073)
@@ -137,7 +137,10 @@
uint16 *wp;
*values = NULL;
-
+
+ if ( !multi_string || !*values )
+ return 0;
+
/* just count the NULLs */
for ( i=0; (i<multi_len-1) && !(multi_string[i]==0x0 && multi_string[i+1]==0x0); i++ ) {
@@ -183,6 +186,9 @@
size_t buf_size = 0;
uint16 *buf, *b;
UNISTR2 sz;
+
+ if ( !values || !*buffer )
+ return 0;
/* go ahead and alloc some space */
More information about the samba-cvs
mailing list