summaryrefslogtreecommitdiff
path: root/src/eir.c
diff options
context:
space:
mode:
authorChen Ganir <chen.ganir@ti.com>2012-05-09 12:21:15 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-05-15 10:56:57 +0300
commitef136177b7e0719f18af64d045391f70b9cc2530 (patch)
tree172615960cf48b3018ab98e9617e323601c4628c /src/eir.c
parenta705c53ef2f5dd7d93618ab194beec6d347d11d5 (diff)
downloadbluez-ef136177b7e0719f18af64d045391f70b9cc2530.tar.gz
eir: Keep parsed eir_data on error
Do not discard already parsed eir_data on eir data length error. Data corruption may occur, but this does not mean that we need to ignore already parsed valid eir data.
Diffstat (limited to 'src/eir.c')
-rw-r--r--src/eir.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/eir.c b/src/eir.c
index 310cd5360..9d429172c 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -114,11 +114,9 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data, uint8_t eir_len)
len += field_len + 1;
- /* Bail out if got incorrect length */
- if (len > eir_len) {
- eir_data_free(eir);
- return -EINVAL;
- }
+ /* Do not continue EIR Data parsing if got incorrect length */
+ if (len > eir_len)
+ break;
data_len = field_len - 1;