Skip to contentSkip to conversation

ap: fix off by one error

PATCH Applied James Prestwood 2 participants 2 messages Jan 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ap: fix off by one error

The RSN element was not being allocated properly which caused an invalid read in some cases.

---
 src/ap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/ap.c +1 -1
index e695a67e..ce639907 100644
@@ -2212,7 +2212,7 @@ static bool ap_parse_new_station_ies(const void *data, uint16_t len,
 				goto parse_error;
 
 			rsn = l_memdup(ie_tlv_iter_get_data(&iter) - 2,
-					ie_tlv_iter_get_length(&iter) + 1);
+					ie_tlv_iter_get_length(&iter) + 2);
 			break;
 		case IE_TYPE_EXTENDED_SUPPORTED_RATES:
 			if (ap_parse_supported_rates(&iter, &rates) < 0)
Signature · 1 line
2.26.2
#1 lore raw

Hi James,

Quoted 6 lines · James Prestwood

The RSN element was not being allocated properly which caused an invalid read in some cases.

---
  src/ap.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Regards,
-Denis