Skip to content
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

Fix LWIP warning issues found by Coverity scan #10647

Merged
merged 1 commit into from
Jun 3, 2019

Conversation

tymoteuszblochmobica
Copy link
Contributor

Description

During Coverity scan several potential defects was found.
This PR fix them.

lwip_dns.c in function: dns_add_interface_server
CID 1399051 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)10. buffer_size_warning: Calling strncpy with a maximum size argument of 6 bytes on destination array new_interface_server->interface_name of size 6 bytes might leave the destination string unterminated.
line 434 strncpy(new_interface_server->interface_name, interface_name, INTERFACE_NAME_MAX_SIZE);

lwip_ip4_frag.c in function: ip_reass_free_complete_datagram

CID 1373164 (#1 of 1): Dereference after null check (FORWARD_NULL)7. var_deref_model: Passing null pointer prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 209 ip_reass_dequeue_datagram(ipr, prev);

lwip_ip4_frag.c in function: ip_reass

CID 1373163 (#1-2 of 2): Dereference after null check (FORWARD_NULL)38. var_deref_model: Passing null pointer ipr_prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 663 ip_reass_dequeue_datagram(ipr, ipr_prev);

lwip_api_msg.c in function: lwip_netconn_do_connected

CID 1373162 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)10. var_deref_model: Passing null pointer op_completed_sem to sys_sem_signal, which dereferences it. [show details]
line 1336 sys_sem_signal(op_completed_sem);

https://scan.coverity.com/projects/mbed-os-d90561a2-1b71-4656-a2f4-1721081c2f84?tab=overview

Pull request type

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

Reviewers

@SeppoTakalo
@mikaleppanen
@kjbracey-arm

Release Notes

@ciarmcom
Copy link
Member

@tymoteuszblochmobica, thank you for your changes.
@SeppoTakalo @kjbracey-arm @mikaleppanen @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented May 31, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented May 31, 2019

Test run: SUCCESS

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

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 3, 2019

@tymoteuszblochmobica For future reference, include the warnings being fixed in the commit msg (not only on Github)

I added them to the merge commit msg

@0xc0170 0xc0170 changed the title Fixed LWIP warning issues found by Coverity scan Fix LWIP warning issues found by Coverity scan Jun 3, 2019
@0xc0170 0xc0170 merged commit f069641 into ARMmbed:master Jun 3, 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.

5 participants