mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Only call memcpy in PDUOption if size > 0
This commit is contained in:
@@ -515,7 +515,9 @@ private:
|
||||
}
|
||||
real_size_ = static_cast<uint16_t>(total_size);
|
||||
if (real_size_ <= small_buffer_size) {
|
||||
std::memcpy(payload_.small_buffer, &*start, total_size);
|
||||
if (total_size > 0) {
|
||||
std::memcpy(payload_.small_buffer, &*start, total_size);
|
||||
}
|
||||
}
|
||||
else {
|
||||
payload_.big_buffer_ptr = new data_type[real_size_];
|
||||
|
||||
Reference in New Issue
Block a user