Extra check for tail_size length (#23047)

old-commit-hash: b2a018643f
commatwo_master
Igor Biletskyy 3 years ago committed by GitHub
parent 327767f93f
commit 9055f2df79
  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