-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverity updates #11551
Coverity updates #11551
Conversation
One suggestion : instead of Entire msg would be:
|
@Tharazi97, thank you for your changes. |
drivers/source/FlashIAP.cpp
Outdated
@@ -46,7 +46,7 @@ static inline bool is_aligned(uint32_t number, uint32_t alignment) | |||
} | |||
} | |||
|
|||
FlashIAP::FlashIAP() : _page_buf(nullptr) | |||
FlashIAP::FlashIAP() : _page_buf(nullptr), _flash{nullptr} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another PR already fixing this, see https://github.com/ARMmbed/mbed-os/pull/11494/files
cc @hugueskamba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from PR
Fixes Coverity issue about not initialized members.
Fixes Coverity issue about passing nullptr to memcpy.
Fixes Coverity issue about passing nullptr to memcpy.
Fixes Coverity issue about not initialized members.
CI started meanwhile |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Please review, this could go in if approved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (_text_record) { | |
if (_text_record != nullptr) { |
@@ -40,15 +40,19 @@ URI::URI(uri_identifier_code_t id, const Span<const uint8_t> &uri_field) : | |||
_uri(uri_field.size() ? new uint8_t[uri_id_code_size + uri_field.size()] : NULL), | |||
_uri_size(uri_id_code_size + uri_field.size()) | |||
{ | |||
_uri[uri_id_index] = id; | |||
memcpy(_uri + uri_field_index, uri_field.data(), uri_field.size()); | |||
if (_uri) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (_uri) { | |
if (_uri != nullptr) { |
} | ||
|
||
URI::URI(const URI &other) : | ||
_uri(other._uri ? new uint8_t[other._uri_size] : NULL), | ||
_uri_size(other._uri_size) | ||
{ | ||
memcpy(_uri, other._uri, other._uri_size); | ||
if (_uri) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (_uri) { | |
if (_uri != nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't use that to keep consistency with other if statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, already approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for the ESP8266Interface
part.
Because this is 12 days old, going to rerun CI |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
I think this is good to be merged ? @adbridge |
Description
Changes to eliminate Coverity warnings.
Added simple initialization.
Added checking for null before using
memcpy()
.Pull request type
Reviewers
@jamesbeyond @maciejbocianski
Release Notes