summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2017-06-20 07:19:34 -0400
committerThomas Markwalder <tmark@isc.org>2017-06-20 07:19:34 -0400
commitf45d2f5502fd402eef3f1ea4416f03af31604999 (patch)
treef254990c08d4c9412beaea0b774f7c4f47f2ec0c
parentf2b7c36067372d78410f9808875b7dea765f1091 (diff)
downloadisc-dhcp-f45d2f5502fd402eef3f1ea4416f03af31604999.tar.gz
[v4_1_esv] Added allocation failure error messages to two locations
Merges in rt41185.
-rw-r--r--RELNOTES4
-rw-r--r--client/dhclient.c9
-rw-r--r--common/discover.c10
3 files changed, 18 insertions, 5 deletions
diff --git a/RELNOTES b/RELNOTES
index 57e16ecd..6adea6c4 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -152,6 +152,10 @@ by Eric Young (eay@cryptsoft.com).
at TDS Telecom for reporting this issue.
[ISC-Bugs #35378]
+ - Added error logging to two memory allocation failure checks. Thanks to Bill
+ Parker (wp02855 at gmail dot com) for reporting the issue.
+ [ISC-Bugs #41185]
+
Changes since 4.1-ESV-R14b1
- None
diff --git a/client/dhclient.c b/client/dhclient.c
index 3c140bae..fd5ac2df 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -3465,8 +3465,11 @@ void client_envadd (struct client_state *client,
val = dmalloc (strlen (prefix) + strlen (name) + 1 /* = */ +
len + sizeof *val, MDL);
- if (!val)
+ if (!val) {
+ log_error ("client_envadd: cannot allocate space for variable");
return;
+ }
+
s = val -> string;
strcpy (s, prefix);
strcat (s, name);
@@ -3476,8 +3479,10 @@ void client_envadd (struct client_state *client,
va_start (list, fmt);
vsnprintf (s, len + 1, fmt, list);
va_end (list);
- } else
+ } else {
strcpy (s, spbuf);
+ }
+
val -> next = client -> env;
client -> env = val;
client -> envc++;
diff --git a/common/discover.c b/common/discover.c
index dc02d0a2..706a08c1 100644
--- a/common/discover.c
+++ b/common/discover.c
@@ -3,8 +3,7 @@
Find and identify the network interfaces. */
/*
- * Copyright (c) 2013-2016 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 2004-2009,2011 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
@@ -1459,8 +1458,11 @@ void interface_stash (struct interface_info *tptr)
delta = tptr -> index - interface_max + 10;
vec = dmalloc ((interface_max + delta) *
sizeof (struct interface_info *), MDL);
- if (!vec)
+ if (!vec) {
+ log_error ("interface_stash: allocation failed ");
return;
+ }
+
memset (&vec [interface_max], 0,
(sizeof (struct interface_info *)) * delta);
interface_max += delta;
@@ -1471,7 +1473,9 @@ void interface_stash (struct interface_info *tptr)
dfree (interface_vector, MDL);
}
interface_vector = vec;
+
}
+
interface_reference (&interface_vector [tptr -> index], tptr, MDL);
if (tptr -> index >= interface_count)
interface_count = tptr -> index + 1;