From 35d2502af5f47524249ddb32a172f4e5b96ac4ac Mon Sep 17 00:00:00 2001 From: Eduardo Beloni Date: Tue, 4 Oct 2011 09:27:20 -0300 Subject: [PATCH] channels/drdynvc/audin: fix segfault when device name is not specified --- channels/drdynvc/audin/alsa/audin_alsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/channels/drdynvc/audin/alsa/audin_alsa.c b/channels/drdynvc/audin/alsa/audin_alsa.c index 26da82929..1fea07e3a 100644 --- a/channels/drdynvc/audin/alsa/audin_alsa.c +++ b/channels/drdynvc/audin/alsa/audin_alsa.c @@ -333,7 +333,8 @@ int FreeRDPAudinDeviceEntry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) if (data && data->data[0] && strcmp(data->data[0], "audin") == 0 && data->data[1] && strcmp(data->data[1], "alsa") == 0) { - strncpy(alsa->device_name, (char*)data->data[2], sizeof(alsa->device_name)); + if (data[2].size) + strncpy(alsa->device_name, (char*)data->data[2], sizeof(alsa->device_name)); } if (alsa->device_name[0] == '\0') {