From 9055f2df7998292f3d22a431898695ab085d6d2a Mon Sep 17 00:00:00 2001 From: Igor Biletskyy Date: Sat, 27 Nov 2021 12:22:54 -0800 Subject: [PATCH] Extra check for tail_size length (#23047) old-commit-hash: b2a018643fb3caa30e7baa5b6be61b8ec4b734f1 --- selfdrive/boardd/panda.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/selfdrive/boardd/panda.cc b/selfdrive/boardd/panda.cc index 6dc458a8c3..efe8555999 100644 --- a/selfdrive/boardd/panda.cc +++ b/selfdrive/boardd/panda.cc @@ -478,6 +478,7 @@ bool Panda::unpack_can_buffer(uint8_t *data, int size, std::vector &o } else { // Keep partial CAN packet until next USB packet tail_size = (chunk_len - pos); + assert(tail_size <= CANPACKET_MAX_SIZE); memcpy(tail, &chunk[pos], tail_size); break; }