OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e41b156
)
android/a2dp: Fix IPC response length calculation
author
Andrzej Kaczmarek
<andrzej.kaczmarek@tieto.com>
Tue, 14 Jan 2014 16:16:18 +0000
(17:16 +0100)
committer
Luiz Augusto von Dentz
<luiz.von.dentz@intel.com>
Wed, 15 Jan 2014 09:10:13 +0000
(11:10 +0200)
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.
android/a2dp.c
patch
|
blob
|
history
diff --git
a/android/a2dp.c
b/android/a2dp.c
index
9f3164a
..
145cd67
100644
(file)
--- 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);