[PATCH] fix munged dial crash

Stefan Metzmacher metze at metzemix.de
Tue Nov 11 18:40:01 GMT 2003


Hi,

here's a small patch that prevents smbd from panic when the munged dial field is empty
like in pdb_ldap now.

Please this shortly

-- 

metze

-------------------------------------------
Stefan (metze) Metzmacher <metze at metzemix.de>
-------------- next part --------------
Index: rpc_parse/parse_misc.c
===================================================================
RCS file: /cvsroot/samba/source/rpc_parse/parse_misc.c,v
retrieving revision 1.94.2.12
diff -u -r1.94.2.12 parse_misc.c
--- rpc_parse/parse_misc.c	7 Nov 2003 18:32:23 -0000	1.94.2.12
+++ rpc_parse/parse_misc.c	11 Nov 2003 18:34:46 -0000
@@ -1016,7 +1016,7 @@
 	str->uni_max_len = str->uni_str_len;
 	str->offset = 0;
 	str->buffer = (uint16 *) memdup(blob->data, blob->length);
-	if (!str->buffer) {
+	if ((str->buffer == NULL) && (blob->length > 0)) {
 		smb_panic("init_unistr2_from_datablob: malloc fail\n");
 	}
 }


More information about the samba-technical mailing list