|
@@ -48,8 +48,12 @@ Pkt::Pkt(const uint8_t* buf, uint32_t len, const isc::asiolink::IOAddress& local
|
|
remote_port_(remote_port),
|
|
remote_port_(remote_port),
|
|
buffer_out_(0)
|
|
buffer_out_(0)
|
|
{
|
|
{
|
|
- data_.resize(len);
|
|
|
|
- if (len) {
|
|
|
|
|
|
+
|
|
|
|
+ if (len != 0) {
|
|
|
|
+ if (buf == NULL) {
|
|
|
|
+ isc_throw(InvalidParameter, "data buffer passed to Pkt is NULL");
|
|
|
|
+ }
|
|
|
|
+ data_.resize(len);
|
|
memcpy(&data_[0], buf, len);
|
|
memcpy(&data_[0], buf, len);
|
|
}
|
|
}
|
|
}
|
|
}
|