svn commit: samba r14770 - in branches/SAMBA_3_0/source/rpc_parse: .

jra at samba.org jra at samba.org
Wed Mar 29 22:56:06 GMT 2006


Author: jra
Date: 2006-03-29 22:56:05 +0000 (Wed, 29 Mar 2006)
New Revision: 14770

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

Log:
Fix coverity bug #257. Possible null deref.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/rpc_parse/parse_misc.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_parse/parse_misc.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_parse/parse_misc.c	2006-03-29 22:51:31 UTC (rev 14769)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_misc.c	2006-03-29 22:56:05 UTC (rev 14770)
@@ -884,6 +884,10 @@
 void init_unistr4(UNISTR4 *uni4, const char *buf, enum unistr2_term_codes flags)
 {
 	uni4->string = TALLOC_P( get_talloc_ctx(), UNISTR2 );
+	if (!uni4->string) {
+		smb_panic("init_unistr4: talloc fail\n");
+		return;
+	}
 	init_unistr2( uni4->string, buf, flags );
 
 	uni4->length = 2 * (uni4->string->uni_str_len);
@@ -893,6 +897,10 @@
 void init_unistr4_w( TALLOC_CTX *ctx, UNISTR4 *uni4, const smb_ucs2_t *buf )
 {
 	uni4->string = TALLOC_P( ctx, UNISTR2 );
+	if (!uni4->string) {
+		smb_panic("init_unistr4_w: talloc fail\n");
+		return;
+	}
 	init_unistr2_w( ctx, uni4->string, buf );
 
 	uni4->length = 2 * (uni4->string->uni_str_len);
@@ -919,7 +927,7 @@
 
 	str->buffer = TALLOC_ZERO_ARRAY(ctx, uint16, len + 1);
 	if (str->buffer == NULL) {
-		smb_panic("init_unistr2_w: malloc fail\n");
+		smb_panic("init_unistr2_w: talloc fail\n");
 		return;
 	}
 	



More information about the samba-cvs mailing list