mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpiutil] DataLog: Fix UB in AppendImpl (#6088)
This commit is contained in:
@@ -743,8 +743,10 @@ void DataLog::AppendImpl(std::span<const uint8_t> data) {
|
||||
std::memcpy(buf, data.data(), kBlockSize);
|
||||
data = data.subspan(kBlockSize);
|
||||
}
|
||||
uint8_t* buf = Reserve(data.size());
|
||||
std::memcpy(buf, data.data(), data.size());
|
||||
if (!data.empty()) {
|
||||
uint8_t* buf = Reserve(data.size());
|
||||
std::memcpy(buf, data.data(), data.size());
|
||||
}
|
||||
}
|
||||
|
||||
void DataLog::AppendStringImpl(std::string_view str) {
|
||||
|
||||
Reference in New Issue
Block a user