mirror of https://github.com/ARMmbed/mbed-os.git
NFC-Text: fix passing null pointer to a function.
Fixes Coverity issue about passing nullptr to memcpy.pull/11551/head
parent
081183c11e
commit
d83cbb8766
|
@ -41,8 +41,10 @@ Text::Text(const Text &other) :
|
||||||
_text_record(other._text_record ? new uint8_t[other._text_record_size] : NULL),
|
_text_record(other._text_record ? new uint8_t[other._text_record_size] : NULL),
|
||||||
_text_record_size(other._text_record_size)
|
_text_record_size(other._text_record_size)
|
||||||
{
|
{
|
||||||
|
if (_text_record) {
|
||||||
memcpy(_text_record, other._text_record, _text_record_size);
|
memcpy(_text_record, other._text_record, _text_record_size);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Text::Text(
|
Text::Text(
|
||||||
encoding_t text_encoding,
|
encoding_t text_encoding,
|
||||||
|
|
Loading…
Reference in New Issue