Extra check for tail_size length (#23047)

pull/23131/head
Igor Biletskyy 3 years ago committed by GitHub
parent c6f62ebc4f
commit b2a018643f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      selfdrive/boardd/panda.cc

@ -478,6 +478,7 @@ bool Panda::unpack_can_buffer(uint8_t *data, int size, std::vector<can_frame> &o
} else { } else {
// Keep partial CAN packet until next USB packet // Keep partial CAN packet until next USB packet
tail_size = (chunk_len - pos); tail_size = (chunk_len - pos);
assert(tail_size <= CANPACKET_MAX_SIZE);
memcpy(tail, &chunk[pos], tail_size); memcpy(tail, &chunk[pos], tail_size);
break; break;
} }

Loading…
Cancel
Save