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:
3424dc8
)
eir: Fix incorrect eir_has_data_type() parsing
author
Syam Sidhardhan
<s.syam@samsung.com>
Mon, 16 Apr 2012 13:01:38 +0000
(18:31 +0530)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Mon, 16 Apr 2012 19:55:54 +0000
(22:55 +0300)
Updating the "parsed" variable twice inside the for loop, leads to
incorrect parsing.
src/eir.c
patch
|
blob
|
history
diff --git
a/src/eir.c
b/src/eir.c
index
3b2db9e
..
310cd53
100644
(file)
--- a/
src/eir.c
+++ b/
src/eir.c
@@
-342,9
+342,9
@@
void eir_create(const char *name, int8_t tx_power, uint16_t did_vendor,
gboolean eir_has_data_type(uint8_t *data, size_t len, uint8_t type)
{
uint8_t field_len;
- size_t parsed;
+ size_t parsed
= 0
;
-
for (parsed = 0; parsed < len - 1; parsed += field_len
) {
+
while (parsed < len - 1
) {
field_len = data[0];
if (field_len == 0)