Blame SOURCES/rdpsnd-pulse-Fix-crash-if-device-isn-t-specified.patch

0c7016
From 800c865bd79e3e4437cceb3219246cfad152205b Mon Sep 17 00:00:00 2001
0c7016
From: Ondrej Holy <oholy@redhat.com>
0c7016
Date: Thu, 11 Jun 2015 13:35:21 +0200
0c7016
Subject: [PATCH] rdpsnd/pulse: Fix crash if device isn't specified
0c7016
0c7016
Freerdp crashes if pulseaudio device isn't specified on commandline, i.e.:
0c7016
xfreerdp --plugin rdpsnd --data pulse
0c7016
0c7016
The crash occurs, because data[1] is NULL and it is passed into strlen
0c7016
function. We have to check whether data[1] was set before calling strlen
0c7016
to fix this crash.
0c7016
---
0c7016
 channels/rdpsnd/pulse/rdpsnd_pulse.c | 2 +-
0c7016
 1 file changed, 1 insertion(+), 1 deletion(-)
0c7016
0c7016
diff --git a/channels/rdpsnd/pulse/rdpsnd_pulse.c b/channels/rdpsnd/pulse/rdpsnd_pulse.c
0c7016
index 1a331f0..54892cd 100644
0c7016
--- a/channels/rdpsnd/pulse/rdpsnd_pulse.c
0c7016
+++ b/channels/rdpsnd/pulse/rdpsnd_pulse.c
0c7016
@@ -474,7 +474,7 @@ int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints)
0c7016
 	data = pEntryPoints->plugin_data;
0c7016
 	if (data && strcmp((char*)data->data[0], "pulse") == 0)
0c7016
 	{
0c7016
-		if(strlen((char*)data->data[1]) > 0) 
0c7016
+		if(data->data[1] && strlen((char*)data->data[1]) > 0)
0c7016
 			pulse->device_name = xstrdup((char*)data->data[1]);
0c7016
 		else
0c7016
 			pulse->device_name = NULL;
0c7016
-- 
0c7016
2.5.0
0c7016