summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2017-12-18 13:50:03 -0500
committerThomas Markwalder <tmark@isc.org>2017-12-18 13:50:03 -0500
commite8b058cfa5bc027201f8d9924e419964e5c1e0ac (patch)
tree79a0aaf6aced72cf93abde9bbbac54bab3b83e4d
parent1e80a731f0b8755b527b37a3e7e5a96938188273 (diff)
downloadisc-dhcp-e8b058cfa5bc027201f8d9924e419964e5c1e0ac.tar.gz
[master] Fixes minor coverity issues
Merges in rt46836
-rw-r--r--RELNOTES3
-rw-r--r--client/dhc6.c9
-rw-r--r--server/ddns.c6
-rw-r--r--server/dhcpv6.c2
4 files changed, 11 insertions, 9 deletions
diff --git a/RELNOTES b/RELNOTES
index 6c187473..feab3810 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -273,6 +273,9 @@ dhcp-users@lists.isc.org.
default). You must compile with one or the other but not both.
[ISC-Bugs #42446]
+- Corrected some minor coverity issues: CID 1426059, 1426058, and 1426057.
+ [ISC-Bugs #46836]
+
Changes since 4.3.6 (Bugs):
- Corrected an issue where the server would return a client's previously
diff --git a/client/dhc6.c b/client/dhc6.c
index b5a35f4b..16a08380 100644
--- a/client/dhc6.c
+++ b/client/dhc6.c
@@ -5141,12 +5141,9 @@ do_decline6(void *input)
decline_done:
/* We here because we've exhausted our retry limits or
* something else has gone wrong with the decline process.
- * So let's just toss the existing lease and start over.
- */
- if (client->active_lease != NULL) {
- dhc6_lease_destroy(&client->active_lease, MDL);
- client->active_lease = NULL;
- }
+ * So let's just toss the existing lease and start over. */
+ dhc6_lease_destroy(&client->active_lease, MDL);
+ client->active_lease = NULL;
start_init6(client);
return;
diff --git a/server/ddns.c b/server/ddns.c
index 396eda5d..6ac79839 100644
--- a/server/ddns.c
+++ b/server/ddns.c
@@ -1577,7 +1577,7 @@ ddns_fwd_srv_add3(dhcp_ddns_cb_t *ddns_cb,
{
isc_result_t result;
const char *logstr = NULL;
- char ddns_address[MAX_ADDRESS_STRING_LEN];
+ char ddns_address[MAX_ADDRESS_STRING_LEN+1];
#if defined (DEBUG_DNS_UPDATES)
log_info ("DDNS: ddns_fwd_srv_add3: %s eresult: %d",
@@ -1585,7 +1585,9 @@ ddns_fwd_srv_add3(dhcp_ddns_cb_t *ddns_cb,
#endif
/* Construct a printable form of the address for logging */
- strcpy(ddns_address, piaddr(ddns_cb->address));
+ memset(ddns_address, 0x0, sizeof(ddns_address));
+ strncpy(ddns_address, piaddr(ddns_cb->address),
+ sizeof(ddns_address) - 1);
switch(eresult) {
case ISC_R_SUCCESS:
diff --git a/server/dhcpv6.c b/server/dhcpv6.c
index bb613a74..4fdb2ceb 100644
--- a/server/dhcpv6.c
+++ b/server/dhcpv6.c
@@ -3295,7 +3295,7 @@ void shorten_lifetimes(struct reply_state *reply, struct iasubopt *lease,
/* If address matches (and for PDs the prefix len matches)
* we assume this is our subopt, so update the lifetimes */
if (!memcmp(oc->data.data + addr_offset, &lease->addr, 16) &&
- (subopt_type != D6O_IA_PD ||
+ (subopt_type != D6O_IAPREFIX ||
(oc->data.data[IASUBOPT_PD_PREFLEN_OFFSET] ==
lease->plen))) {
u_int32_t pref_life = getULong(oc->data.data +