Extra check for tail_size length (#23047)

pull/23131/head
Igor Biletskyy 2021-11-27 12:22:54 -08:00 committed by GitHub
parent c6f62ebc4f
commit b2a018643f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

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;
}