From 6656992c906b830c3ae365cbcc2a96f286751023 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 4 Jun 2013 08:24:50 +0700 Subject: [PATCH] AVRCP: Fix crash while listing available settings in TG role Invalid read of size 1 at 0x41AFD0: attrval_to_val (avrcp.c:492) by 0x41B0E1: avrcp_handle_list_player_attributes (avrcp.c:931) by 0x41D606: handle_vendordep_pdu (avrcp.c:1620) by 0x4185F8: session_cb (avctp.c:985) by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2) by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2) by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2) by 0x40A2E5: main (main.c:595) Address 0x0 is not stack'd, malloc'd or (recently) free'd --- profiles/audio/avrcp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index dac7ecece..94cb92226 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -548,6 +548,8 @@ static int player_get_setting(struct avrcp_player *player, uint8_t id) return -EINVAL; value = player->cb->get_setting(key, player->user_data); + if (value == NULL) + return -EINVAL; return attrval_to_val(id, value); } -- 2.47.3