[PATCH BlueZ 1/3] Fix wrong offset in EIR name parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When looking for NUL byte terminators on EIR names, the first two bytes
of the EIR field should be skipped, which correspond to field length and
EIR type.
---
 src/eir.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/eir.c b/src/eir.c
index 1b68949..ff50cf8 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -159,7 +159,8 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data, uint8_t eir_len)
 			 * the name */
 			name_len = field_len - 1;
 
-			while (name_len > 0 && eir_data[name_len - 1] == '\0')
+			while (name_len > 0 &&
+					eir_data[2 + name_len - 1] == '\0')
 				name_len--;
 
 			if (!g_utf8_validate((char *) &eir_data[2],
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux