[Git][NTPsec/ntpsec][master] 2 commits: Yet another attempt at Coverity false-positive suppression.
Eric S. Raymond
gitlab at mg.gitlab.com
Wed Sep 2 11:36:42 UTC 2020
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
c4a9af3d by Eric S. Raymond at 2020-09-02T07:37:46-04:00
Yet another attempt at Coverity false-positive suppression.
- - - - -
94f2af41 by Eric S. Raymond at 2020-09-02T07:37:46-04:00
Code cleanup as suggested by James Browning.
His suggestion was in comments to Gitliab ussue #664.
- - - - -
2 changed files:
- ntpd/ntp_io.c
- tests/unity/unity_memory.c
Changes:
=====================================
ntpd/ntp_io.c
=====================================
@@ -233,7 +233,7 @@ static void delete_interface_from_list(endpt *);
static void close_and_delete_fd_from_list(SOCKET);
static void add_addr_to_list (sockaddr_u *, endpt *);
static void create_wildcards (unsigned short);
-static endpt * findlocalinterface (sockaddr_u *, int);
+static endpt * findlocalinterface (sockaddr_u *);
static endpt * findclosestinterface (sockaddr_u *, int);
#ifdef DEBUG
@@ -2473,7 +2473,7 @@ findinterface(
{
endpt *iface;
- iface = findlocalinterface(addr, INT_WILDCARD);
+ iface = findlocalinterface(addr);
if (NULL == iface) {
DPRINT(4, ("Found no interface for address %s - returning wildcard\n",
@@ -2504,8 +2504,7 @@ findinterface(
*/
static endpt *
findlocalinterface(
- sockaddr_u * addr,
- int flags
+ sockaddr_u * addr
)
{
socklen_t sockaddrlen;
@@ -2513,6 +2512,7 @@ findlocalinterface(
sockaddr_u saddr;
SOCKET s;
int rtn;
+ int flags = INT_WILDCARD;
DPRINT(4, ("Finding interface for addr %s in list of addresses\n",
socktoa(addr)));
=====================================
tests/unity/unity_memory.c
=====================================
@@ -172,6 +172,7 @@ void* unity_realloc(void* oldMem, size_t size)
{
release_memory(oldMem);
UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during realloc()");
+ return NULL;
}
else if (size == 0)
{
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/1f82b34c570a5dfd2ffde560b915c3c77bb6640e...94f2af419ace4cd69429b213f30e654cdf1cae2d
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/1f82b34c570a5dfd2ffde560b915c3c77bb6640e...94f2af419ace4cd69429b213f30e654cdf1cae2d
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20200902/be4bc752/attachment-0001.htm>
More information about the vc
mailing list