fix crash bug due to empyrt munged dial string; patch from metze
authorGerald Carter <jerry@samba.org>
Tue, 11 Nov 2003 19:22:00 +0000 (19:22 +0000)
committerGerald Carter <jerry@samba.org>
Tue, 11 Nov 2003 19:22:00 +0000 (19:22 +0000)
(This used to be commit ccd5665a65de6ccfdb9a5f490be1a7b5de486e2a)

source3/rpc_parse/parse_misc.c

index 86ea83d7aa8819b67778662672671e95d8658f39..203122e73c0ebc150afddb841ac45e64a3cdde31 100644 (file)
@@ -1016,7 +1016,7 @@ void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob)
        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");
        }
 }