Extra check for tail_size length (#23047)

old-commit-hash: b2a018643fb3caa30e7baa5b6be61b8ec4b734f1
This commit is contained in:
Igor Biletskyy
2021-11-27 12:22:54 -08:00
committed by GitHub
parent 327767f93f
commit 9055f2df79
+1
View File
@@ -478,6 +478,7 @@ bool Panda::unpack_can_buffer(uint8_t *data, int size, std::vector<can_frame> &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;
}