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

Coverity likes coverity #6269

Merged
merged 2 commits into from
Apr 22, 2020
Merged

Conversation

donaldsharp
Copy link
Member

couple more issues found by coverity

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/8b7780f344cd4012b6f07ad5e29ab6d4/raw/d8d685551d77df758faee1ecf93dfeaabaa13756/cr_6269_1587499485.diff | git apply

diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c
index 83bf033ab..8b1cf0208 100644
--- a/ospfd/ospf_api.c
+++ b/ospfd/ospf_api.c
@@ -379,7 +379,8 @@ struct msg *msg_read(int fd)
 	/* Determine body length. */
 	bodylen = ntohs(hdr.msglen);
 	if (bodylen > (ssize_t)sizeof(buf)) {
-		zlog_warn("msg_read: Body Length of message greater than what we can read");
+		zlog_warn(
+			"msg_read: Body Length of message greater than what we can read");
 		return NULL;
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 21, 2020

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11979/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for ospf_api.c | 2 issues
===============================================
< WARNING: Prefer using '"%s...", __func__' to using 'msg_read', this function's name, in a string
< #390: FILE: /tmp/f1-7343/ospf_api.c:390:

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11979/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200421-01-g06cd19e66-0 (missing) -> 7.4-dev-20200421-01-g06cd19e66-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200421-01-g06cd19e66-0 (missing) -> 7.4-dev-20200421-01-g06cd19e66-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200421-01-g06cd19e66-0 (missing) -> 7.4-dev-20200421-01-g06cd19e66-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200421-01-g06cd19e66-0 (missing) -> 7.4-dev-20200421-01-g06cd19e66-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200421-01-g06cd19e66-0 (missing) -> 7.4-dev-20200421-01-g06cd19e66-0~deb10u1

CLANG Static Analyzer Summary

  • Github Pull Request 6269, comparing to Git base SHA 64fbc17
  • Base image data for Git 64fbc17 does not exist - compare skipped

4 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11979/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 21, 2020

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/6269 06cd19e
Date 04/21/2020
Start 17:22:43
Finish 17:48:35
Run-Time 25:52
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2020-04-21-17:22:43.txt
Log autoscript-2020-04-21-17:23:37.log.bz2
Memory 496 476 424

For details, please contact louberger

ospfd/ospf_api.c Outdated Show resolved Hide resolved
There are a couple of switch statements in netlink_route_info_encode
in zebra_fpm_netlink.c that had logically dead code.  We have
a switch statement let's take actual advantage of it instead
of doing gyrations to what we want.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
It's possible(but unlikely) that a read of data from the
network will give us bogus data.  Don't automatically
just trust the data size from the network and limit
the read to the size of the buffer we have in play.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
@donaldsharp donaldsharp force-pushed the coverity_likes_coverity branch from 06cd19e to e1c511c Compare April 22, 2020 11:31
Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution to FRR!

Click for style suggestions

To apply these suggestions:

curl -s https://gist.githubusercontent.com/polychaeta/1220189a7f71888bea2d15ee626c4bc4/raw/a6191c421085c8974ae82be294c4f7e8d21a8e3f/cr_6269_1587555102.diff | git apply

diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c
index 7e7236a3b..e33a37777 100644
--- a/ospfd/ospf_api.c
+++ b/ospfd/ospf_api.c
@@ -379,8 +379,9 @@ struct msg *msg_read(int fd)
 	/* Determine body length. */
 	bodylen = ntohs(hdr.msglen);
 	if (bodylen > (ssize_t)sizeof(buf)) {
-		zlog_warn("%s: Body Length of message greater than what we can read",
-			  __func__);
+		zlog_warn(
+			"%s: Body Length of message greater than what we can read",
+			__func__);
 		return NULL;
 	}
 

If you are a new contributor to FRR, please see our contributing guidelines.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Apr 22, 2020

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/6269 e1c511c
Date 04/22/2020
Start 08:22:44
Finish 08:48:33
Run-Time 25:49
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2020-04-22-08:22:44.txt
Log autoscript-2020-04-22-08:23:40.log.bz2
Memory 466 481 425

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11985/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-11985/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200422-02-ge1c511c69-0 (missing) -> 7.4-dev-20200422-02-ge1c511c69-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200422-02-ge1c511c69-0 (missing) -> 7.4-dev-20200422-02-ge1c511c69-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200422-02-ge1c511c69-0 (missing) -> 7.4-dev-20200422-02-ge1c511c69-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200422-02-ge1c511c69-0 (missing) -> 7.4-dev-20200422-02-ge1c511c69-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.4-dev-20200422-02-ge1c511c69-0 (missing) -> 7.4-dev-20200422-02-ge1c511c69-0~deb10u1

@ton31337 ton31337 merged commit 0f90b81 into FRRouting:master Apr 22, 2020
@donaldsharp donaldsharp deleted the coverity_likes_coverity branch July 8, 2020 11:58
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