Commit: 9122bd7ec7df653cbf7443282636693470b73f89
Parent: 402398c7dc8c759d0ba0a110f38ce91cbb6fa4aa
Author: Johan Hedberg <johan.hedberg@intel.com>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2011-10-14 11:15:14
Tree: 00e727da8a9496bf1d524acb4e22d4537f57bb77

Fix leaks and buffer overflows in EIR parsing By calling g_utf8_validate and allocating eir->name inside the parsing loop the code was exposing itself to buffer overflows and memory leaks. This is because the check for incorrect length fields is only done after exiting the loop (if (len > HCI_MAX_EIR_LENGTH)). By only setting a pointer to the name and doing the processing after checking the length validity both issues can be avoided.

Diffstat

M src/eir.c | 17 +++++++++++- - - - - -

1 files changed, 11 insertions(+), 6 deletions(-)

View Full Diff | Patch