Check the full MBIE length against the buffer length explicitly before
the debug print. This is for locally generated data, so the bounds
checking is not critical here, but it is better to use proper checking
anyway to avoid static analyzer complaints.
Signed-off-by: Jouni Malinen <j@w1.fi>
while (s >= 2) {
const struct multi_band_ie *mbie =
(const struct multi_band_ie *) p;
+ size_t len;
+
WPA_ASSERT(mbie->eid == WLAN_EID_MULTI_BAND);
WPA_ASSERT(2U + mbie->len >= sizeof(*mbie));
+ len = 2 + mbie->len;
+ if (len > s)
+ break;
fst_printf(MSG_WARNING,
"%s: %s: mb_ctrl=%u band_id=%u op_class=%u chan=%u bssid="
mbie->mb_connection_capability,
mbie->fst_session_tmout);
- p += 2 + mbie->len;
- s -= 2 + mbie->len;
+ p += len;
+ s -= len;
}
}