summaryrefslogtreecommitdiff
path: root/android/a2dp.c
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2014-01-14 17:16:18 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-15 11:10:13 +0200
commit63ffbe33a5545eea9a007987d86ef7844daf141d (patch)
tree61f681875ee0d4b538809fdbeebd79a16c359d2f /android/a2dp.c
parente41b156caec627682d8a09fa2a5eccedbdc4fed1 (diff)
downloadbluez-63ffbe33a5545eea9a007987d86ef7844daf141d.tar.gz
android/a2dp: Fix IPC response length calculation
struct audio_rsp_open_stream has only zero-length array member thus its size equals to 0. We need to explicitly specify size of array element type here.
Diffstat (limited to 'android/a2dp.c')
-rw-r--r--android/a2dp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/android/a2dp.c b/android/a2dp.c
index 9f3164ac1..145cd6738 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -1088,8 +1088,8 @@ static void bt_stream_open(const void *buf, uint16_t len)
return;
}
- len = sizeof(*rsp) + setup->preset->len;
- rsp = g_malloc0(sizeof(*rsp) + setup->preset->len);
+ len = sizeof(struct audio_preset) + setup->preset->len;
+ rsp = g_malloc0(len);
rsp->preset->len = setup->preset->len;
memcpy(rsp->preset->data, setup->preset->data, setup->preset->len);