rdpsnd/pulse: fix a segfault in case device name is not provided.
authorVic Lee <llyzs@163.com>
Wed, 9 May 2012 11:18:47 +0000 (19:18 +0800)
committerVic Lee <llyzs@163.com>
Wed, 9 May 2012 11:18:47 +0000 (19:18 +0800)
channels/rdpsnd/pulse/rdpsnd_pulse.c

index 1a331f0..86e0793 100644 (file)
@@ -474,7 +474,7 @@ int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
        data = pEntryPoints->plugin_data;
        if (data && strcmp((char*)data->data[0], "pulse") == 0)
        {
-               if(strlen((char*)data->data[1]) > 0) 
+               if(data->data[1] && strlen((char*)data->data[1]) > 0) 
                        pulse->device_name = xstrdup((char*)data->data[1]);
                else
                        pulse->device_name = NULL;