File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
features/nfc/source/nfc/ndef/common Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,19 @@ URI::URI(uri_identifier_code_t id, const Span<const uint8_t> &uri_field) :
40
40
_uri (uri_field.size() ? new uint8_t [uri_id_code_size + uri_field.size()] : NULL ),
41
41
_uri_size (uri_id_code_size + uri_field.size())
42
42
{
43
- _uri[uri_id_index] = id;
44
- memcpy (_uri + uri_field_index, uri_field.data (), uri_field.size ());
43
+ if (_uri) {
44
+ _uri[uri_id_index] = id;
45
+ memcpy (_uri + uri_field_index, uri_field.data (), uri_field.size ());
46
+ }
45
47
}
46
48
47
49
URI::URI (const URI &other) :
48
50
_uri (other._uri ? new uint8_t [other._uri_size] : NULL ),
49
51
_uri_size (other._uri_size)
50
52
{
51
- memcpy (_uri, other._uri , other._uri_size );
53
+ if (_uri) {
54
+ memcpy (_uri, other._uri , other._uri_size );
55
+ }
52
56
}
53
57
54
58
URI::~URI ()
You can’t perform that action at this time.
0 commit comments