Skip to content

Commit

Permalink
TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane authored and martinl committed Aug 29, 2024
1 parent f027059 commit 2a7e1f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion can/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ void CANParser::UpdateCans(uint64_t nanos, const capnp::List<cereal::CanData>::R
// DEBUG("got message with unexpected length: expected %d, got %zu for %d", state_it->second.size, dat.size(), cmsg.getAddress());
// continue;
//}
// make sure the data_size if not less than state_it->second.size.

// TODO: can remove when we ignore unexpected can msg lengths
// make sure the data_size is not less than state_it->second.size
size_t data_size = std::max<size_t>(dat.size(), state_it->second.size);
std::vector<uint8_t> data(data_size, 0);
memcpy(data.data(), dat.begin(), dat.size());
Expand Down

0 comments on commit 2a7e1f6

Please sign in to comment.