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

source3/rpc_parse/parse_misc.c

index b0144c2c8938247a46b05c9e9742e340dbe03fe3..cd59d390aa3a371f4be01cb75700e91695ae0b6c 100644 (file)
@@ -1044,7 +1044,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");
        }
 }