[PATCH BlueZ 07/15] AVRCP: Fix crash if player status is NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

Assume status is 'stopped' in case the status is NULL.
---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 66ab2b4..45ca490 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -575,7 +575,7 @@ static int player_get_setting(struct avrcp_player *player, uint8_t id)
 
 static int play_status_to_val(const char *status)
 {
-	if (!strcasecmp(status, "stopped"))
+	if (status == NULL || !strcasecmp(status, "stopped"))
 		return AVRCP_PLAY_STATUS_STOPPED;
 	else if (!strcasecmp(status, "playing"))
 		return AVRCP_PLAY_STATUS_PLAYING;
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux