Add check to avoid using memcpy with an invalid data pointer
This commit is contained in:
parent
75423a100c
commit
485df52b0f
|
@ -625,7 +625,9 @@ public:
|
|||
|
||||
// Copies string contents to dst and returns a pointer to the next byte after
|
||||
uint8_t* copyTo(uint8_t* dst) const {
|
||||
memcpy(dst, data, length);
|
||||
if (length > 0) {
|
||||
memcpy(dst, data, length);
|
||||
}
|
||||
return dst + length;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue