diff options
author | Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> | 2014-01-14 17:16:18 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-01-15 11:10:13 +0200 |
commit | 63ffbe33a5545eea9a007987d86ef7844daf141d (patch) | |
tree | 61f681875ee0d4b538809fdbeebd79a16c359d2f /android/a2dp.c | |
parent | e41b156caec627682d8a09fa2a5eccedbdc4fed1 (diff) | |
download | bluez-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.c | 4 |
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); |