<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>Eric S. Raymond pushed to branch master at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475">41dbe2da</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-07T05:44:13Z</i>
</div>
<pre class='commit-message'>Coverity warning cleanup.
Mostly new defecvts introduced by tests. One potential overrun found in the
Palisade refclock.</pre>
</li>
</ul>
<h4>12 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
ntpd/ntp_intercept.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_io.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
ntpd/ntp_util.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
ntpd/refclock_palisade.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
tests/libntp/calendar.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
tests/libntp/caljulian.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
tests/ntpdig/kod_file.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-7'>
tests/ntpdig/packet_handling.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-8'>
tests/ntpdig/packet_processing.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-9'>
tests/ntpdig/utilities.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-10'>
tests/unity/unity_fixture.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-11'>
util/bumpclock.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-0'>
<strong>
ntpd/ntp_intercept.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_intercept.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_intercept.c
</span><span style="color: #aaaaaa">@@ -293,7 +293,7 @@ intercept_leapsec_load_file(
</span> bool force,
bool logall)
{
<span style="color: #000000;background-color: #ffdddd">- bool loaded;
</span><span style="color: #000000;background-color: #ddffdd">+ bool loaded = true;
</span>
if (mode != replay)
loaded = leapsec_load_file(fname, sb_old, force, logall);
</code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-1'>
<strong>
ntpd/ntp_io.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_io.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_io.c
</span><span style="color: #aaaaaa">@@ -3484,6 +3484,7 @@ read_network_packet(
</span> msghdr.msg_namelen = fromlen;
msghdr.msg_iov = &iovec;
msghdr.msg_iovlen = 1;
<span style="color: #000000;background-color: #ddffdd">+ msghdr.msg_flags = 0;
</span> msghdr.msg_control = (void *)&control;
msghdr.msg_controllen = sizeof(control);
rb->recv_length = recvmsg(fd, &msghdr, 0);
</code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-2'>
<strong>
ntpd/ntp_util.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_util.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_util.c
</span><span style="color: #aaaaaa">@@ -212,7 +212,7 @@ stats_config(
</span> FILE *fp;
const char *value;
int len;
<span style="color: #000000;background-color: #ffdddd">- double new_drift;
</span><span style="color: #000000;background-color: #ddffdd">+ double new_drift = 0;
</span> l_fp now;
time_t ttnow;
const char temp_ext[] = ".TEMP";
</code></pre>
<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-3'>
<strong>
ntpd/refclock_palisade.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/refclock_palisade.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/refclock_palisade.c
</span><span style="color: #aaaaaa">@@ -1062,8 +1062,9 @@ palisade_io (
</span> case TSIP_PARSED_DLE_2:
if (*c == DLE) {
up->rpt_status = TSIP_PARSED_DATA;
<span style="color: #000000;background-color: #ffdddd">- mb(up->rpt_cnt++) =
- *c;
</span><span style="color: #000000;background-color: #ddffdd">+ /* prevent overrun - should never happen */
+ if (up->rpt_cnt < BMAX - 2)
+ mb(up->rpt_cnt++) = *c;
</span> }
else if (*c == ETX)
up->rpt_status = TSIP_PARSED_FULL;
</code></pre>
<br>
</li>
<li id='diff-4'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-4'>
<strong>
tests/libntp/calendar.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/libntp/calendar.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/libntp/calendar.c
</span><span style="color: #aaaaaa">@@ -38,6 +38,7 @@ bool IsEqualCA(const struct calendar *expected, const struct calendar *actual) {
</span> expected->second == actual->second) {
return true;
} else {
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> printf("Expected: %s but was %s\n", CalendarToString(expected), CalendarToString(actual));
return false;
}
<span style="color: #aaaaaa">@@ -53,6 +54,7 @@ bool IsEqualISO(const struct isodate *expected, const struct isodate *actual) {
</span> expected->second == actual->second) {
return true;
} else {
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> printf("Expected: %s but was %s\n", CalendarToStringISO(expected), CalendarToStringISO(actual));
return false;
}
<span style="color: #aaaaaa">@@ -80,6 +82,7 @@ bool IsEqualDate(const struct calendar *expected, const struct calendar *actual)
</span> expected->monthday == actual->monthday) {
return true;
} else {
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> printf("Expected: %s but was %s\n", DateToString(expected), DateToString(actual));
return false;
}
<span style="color: #aaaaaa">@@ -92,6 +95,7 @@ bool IsEqualDateISO(const struct isodate *expected, const struct isodate *actual
</span> expected->weekday == actual->weekday) {
return true;
} else {
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> printf("Expected: %s but was %s\n", DateToStringISO(expected), DateToStringISO(actual));
return false;
}
</code></pre>
<br>
</li>
<li id='diff-5'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-5'>
<strong>
tests/libntp/caljulian.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/libntp/caljulian.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/libntp/caljulian.c
</span><span style="color: #aaaaaa">@@ -30,6 +30,7 @@ bool IsEqualC(const struct calendar *expected, const struct calendar *actual) {
</span> expected->second == actual->second) {
return true;
} else {
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> printf("expected: %s but was %s", CalendarToString(expected), CalendarToString(actual));
return false;
</code></pre>
<br>
</li>
<li id='diff-6'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-6'>
<strong>
tests/ntpdig/kod_file.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/ntpdig/kod_file.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/ntpdig/kod_file.c
</span><span style="color: #aaaaaa">@@ -54,6 +54,7 @@ TEST(kodFile, ReadCorrectFile) {
</span> TEST_ASSERT_EQUAL_STRING("RSTR", res->type);
TEST_ASSERT_EQUAL_STRING("192.0.2.100", res->hostname);
TEST_ASSERT_EQUAL(0xfff, res->timestamp);
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> }
TEST(kodFile, ReadFileWithBlankLines) {
<span style="color: #aaaaaa">@@ -80,6 +81,7 @@ TEST(kodFile, ReadFileWithBlankLines) {
</span> TEST_ASSERT_EQUAL_STRING("DENY", res->type);
TEST_ASSERT_EQUAL_STRING("example.com", res->hostname);
TEST_ASSERT_EQUAL(0xabcd, res->timestamp);
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> }
TEST(kodFile, WriteEmptyFile) {
</code></pre>
<br>
</li>
<li id='diff-7'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-7'>
<strong>
tests/ntpdig/packet_handling.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/ntpdig/packet_handling.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/ntpdig/packet_handling.c
</span><span style="color: #aaaaaa">@@ -239,6 +239,7 @@ TEST(packetHandling, HandleKodDemobilize) {
</span>
TEST_ASSERT_EQUAL(1, search_entry(HOSTNAME, &entry));
TEST_ASSERT_TRUE(memcmp(REASON, entry->type, 4) == 0);
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> }
TEST(packetHandling, HandleKodRate) {
</code></pre>
<br>
</li>
<li id='diff-8'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-8'>
<strong>
tests/ntpdig/packet_processing.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/ntpdig/packet_processing.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/ntpdig/packet_processing.c
</span><span style="color: #aaaaaa">@@ -105,6 +105,7 @@ TEST(packetProcessing, TooShortExtensionFieldLength) {
</span> #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warray-bounds"
#endif
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[overrun-local] */
</span> testpkt.exten[7] = htonl(3); // 3 bytes is too short.
#ifdef __clang__
#pragma clang diagnostic pop
</code></pre>
<br>
</li>
<li id='diff-9'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-9'>
<strong>
tests/ntpdig/utilities.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/ntpdig/utilities.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/ntpdig/utilities.c
</span><span style="color: #aaaaaa">@@ -20,6 +20,7 @@ const char * Version = "stub unit test Version string";
</span>
struct addrinfo CreateAddrinfo(sockaddr_u* sock) {
struct addrinfo a;
<span style="color: #000000;background-color: #ddffdd">+ memset(&a, '\0', sizeof(struct addrinfo));
</span> a.ai_family = sock->sa.sa_family;
a.ai_addrlen = SIZEOF_SOCKADDR(a.ai_family);
a.ai_addr = &sock->sa;
<span style="color: #aaaaaa">@@ -75,8 +76,11 @@ TEST(utilities, IPv4Address) {
</span> sockaddr_u input = CreateSockaddr4(ADDR, 123);
struct addrinfo inputA = CreateAddrinfo(&input);
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> TEST_ASSERT_EQUAL_STRING(ADDR, ss_to_str(&input));
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> TEST_ASSERT_EQUAL_STRING(ADDR, addrinfo_to_str(&inputA));
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> }
TEST(utilities, IPv6Address) {
<span style="color: #aaaaaa">@@ -93,10 +97,12 @@ TEST(utilities, IPv6Address) {
</span> memset(&input, 0, sizeof(input));
input.sa6.sin6_family = AF_INET6;
input.sa6.sin6_addr = address;
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
</span> TEST_ASSERT_EQUAL_STRING(expected, ss_to_str(&input));
inputA = CreateAddrinfo(&input);
<span style="color: #000000;background-color: #ffdddd">- TEST_ASSERT_EQUAL_STRING(expected, addrinfo_to_str(&inputA));
</span><span style="color: #000000;background-color: #ddffdd">+ /* coverity[leaked_storage] */
+TEST_ASSERT_EQUAL_STRING(expected, addrinfo_to_str(&inputA));
</span> }
TEST(utilities, SetLiVnMode1) {
</code></pre>
<br>
</li>
<li id='diff-10'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-10'>
<strong>
tests/unity/unity_fixture.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/unity/unity_fixture.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/unity/unity_fixture.c
</span><span style="color: #aaaaaa">@@ -284,7 +284,7 @@ typedef struct _PointerPair
</span> } PointerPair;
enum {MAX_POINTERS=50};
<span style="color: #000000;background-color: #ffdddd">-static PointerPair pointer_store[MAX_POINTERS];
</span><span style="color: #000000;background-color: #ddffdd">+static PointerPair pointer_store[MAX_POINTERS+1];
</span> static int pointer_index = 0;
void UnityPointer_Init(void)
<span style="color: #aaaaaa">@@ -295,12 +295,16 @@ void UnityPointer_Init(void)
</span> void UnityPointer_Set(void ** pointer, void * newValue)
{
if (pointer_index >= MAX_POINTERS)
<span style="color: #000000;background-color: #ddffdd">+ {
</span> TEST_FAIL_MESSAGE("Too many pointers set");
<span style="color: #000000;background-color: #ffdddd">-
- pointer_store[pointer_index].pointer = pointer;
- pointer_store[pointer_index].old_value = *pointer;
- *pointer = newValue;
- pointer_index++;
</span><span style="color: #000000;background-color: #ddffdd">+ }
+ else
+ {
+ pointer_store[pointer_index].pointer = pointer;
+ pointer_store[pointer_index].old_value = *pointer;
+ *pointer = newValue;
+ pointer_index++;
+ }
</span> }
void UnityPointer_UndoAllSets(void)
</code></pre>
<br>
</li>
<li id='diff-11'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475#diff-11'>
<strong>
util/bumpclock.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/util/bumpclock.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/util/bumpclock.c
</span><span style="color: #aaaaaa">@@ -25,6 +25,7 @@ int main(int argc, char *argv[]) {
</span> er1 = errno;
set = was;
<span style="color: #000000;background-color: #ddffdd">+ /* coverity[tainted_data] */
</span> set.tv_usec += bump;
while (set.tv_usec >= 1000000 ) {
set.tv_usec -= 1000000;
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/41dbe2da23cb063024d4426817c2b18b7c0fc475"}}</script>
</p>
</div>
</body>
</html>