NFC-Text: fix passing null pointer to a function.

Fixes Coverity issue about passing nullptr to memcpy.
pull/11551/head
int_szyk 2019-09-23 12:10:13 +02:00
parent 081183c11e
commit d83cbb8766
1 changed files with 3 additions and 1 deletions

View File

@ -41,7 +41,9 @@ Text::Text(const Text &other) :
_text_record(other._text_record ? new uint8_t[other._text_record_size] : NULL),
_text_record_size(other._text_record_size)
{
memcpy(_text_record, other._text_record, _text_record_size);
if (_text_record) {
memcpy(_text_record, other._text_record, _text_record_size);
}
}
Text::Text(