Skip to content

Conversation

@Tharazi97
Copy link
Contributor

Description

Changes to eliminate Coverity warnings.
Added simple initialization.
Added checking for null before using memcpy().

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@jamesbeyond @maciejbocianski

Release Notes

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 23, 2019

One suggestion : instead of Coverity changes esp8266-driver commit, although it's simple, we can do: esp8266-driver: fix xyz variable init in ctor, second paragraph in the commit msg would be Fixes coverity issue about not initialized member" or something along the lines.

Entire msg would be:

esp8266-driver: fix xyz variable init in ctor

`Fixes coverity issue about not initialized member"

@ciarmcom ciarmcom requested review from a team, jamesbeyond and maciejbocianski September 23, 2019 13:00
@ciarmcom
Copy link
Member

@Tharazi97, thank you for your changes.
@maciejbocianski @jamesbeyond @ARMmbed/mbed-os-pan @ARMmbed/mbed-os-core @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

}

FlashIAP::FlashIAP() : _page_buf(nullptr)
FlashIAP::FlashIAP() : _page_buf(nullptr), _flash{nullptr}
Copy link
Contributor

@evedon evedon Sep 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 24, 2019

CI started meanwhile

@mbed-ci
Copy link

mbed-ci commented Sep 24, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 25, 2019

Please review, this could go in if approved

Copy link
Collaborator

@hugueskamba hugueskamba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

_text_record_size(other._text_record_size)
{
memcpy(_text_record, other._text_record, _text_record_size);
if (_text_record) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (_text_record) {
if (_text_record != nullptr) {

{
_uri[uri_id_index] = id;
memcpy(_uri + uri_field_index, uri_field.data(), uri_field.size());
if (_uri) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (_uri) {
if (_uri != nullptr) {

_uri_size(other._uri_size)
{
memcpy(_uri, other._uri, other._uri_size);
if (_uri) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (_uri) {
if (_uri != nullptr) {

Copy link
Contributor Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, already approved.

Copy link
Contributor

@michalpasztamobica michalpasztamobica left a 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.

@adbridge
Copy link
Contributor

adbridge commented Oct 7, 2019

Because this is 12 days old, going to rerun CI

@mbed-ci
Copy link

mbed-ci commented Oct 7, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@jamesbeyond
Copy link
Contributor

I think this is good to be merged ? @adbridge

@adbridge adbridge added release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 and removed release-version: 5.14.1 labels Oct 16, 2019
@0xc0170 0xc0170 added release-version: 5.15.0-rc1 and removed release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 labels Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants