[Git][NTPsec/ntpsec][master] Attempt cleaner Coverity suppressions.
Eric S. Raymond
gitlab at mg.gitlab.com
Wed Sep 2 00:08:35 UTC 2020
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
64d85bdc by Eric S. Raymond at 2020-09-01T20:08:43-04:00
Attempt cleaner Coverity suppressions.
- - - - -
2 changed files:
- ntpd/ntp_control.c
- tests/unity/unity_memory.c
Changes:
=====================================
ntpd/ntp_control.c
=====================================
@@ -829,6 +829,7 @@ process_control(
* Set up translate pointers
*/
reqpt = (char *)pkt->data;
+#ifndef __COVERITY__
if (CTL_MAX_DATA_LEN < req_count) {
/* count too big - backstop to prevent stack overflow*/
/* coverity[deadcode] */
@@ -836,6 +837,7 @@ process_control(
numctlbadpkts++;
return;
}
+#endif /* __COVERITY__ */
reqend = reqpt + req_count;
/*
@@ -3202,7 +3204,7 @@ send_random_tag_value(
int noise;
char buf[32];
- /* coverity[dc.weak_crypto] */
+ /* coverity[weak_crypto] */
noise = random();
buf[0] = 'a' + noise % 26;
noise >>= 5;
@@ -3246,7 +3248,7 @@ send_mru_entry(
remaining = COUNTOF(sent);
ZERO(sent);
- /* coverity[dc.weak_crypto] */
+ /* coverity[weak_crypto] */
noise = (uint32_t)random();
while (remaining > 0) {
#ifdef USE_RANDOMIZE_RESPONSES
@@ -3768,7 +3770,7 @@ send_ifstats_entry(
noisebits = 0;
while (remaining > 0) {
if (noisebits < 4) {
- /* coverity[dc.weak_crypto] */
+ /* coverity[weak_crypto] */
noise = (uint32_t)random();
noisebits = 31;
}
@@ -3946,7 +3948,7 @@ send_restrict_entry(
noisebits = 0;
while (remaining > 0) {
if (noisebits < 2) {
- /* coverity[dc.weak_crypto] */
+ /* coverity[weak_crypto] */
noise = (uint32_t)random();
noisebits = 31;
}
=====================================
tests/unity/unity_memory.c
=====================================
@@ -173,8 +173,7 @@ void* unity_realloc(void* oldMem, size_t size)
release_memory(oldMem);
UNITY_TEST_FAIL(Unity.CurrentTestLineNumber, "Buffer overrun detected during realloc()");
}
-
- if (size == 0)
+ else if (size == 0)
{
release_memory(oldMem);
return NULL;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/64d85bdce2d4492fd856bcf8ad42e3a66a8d53f7
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/64d85bdce2d4492fd856bcf8ad42e3a66a8d53f7
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/2b371268/attachment-0001.htm>
More information about the vc
mailing list