Subject: | DHCP 4.3.x - Add log_error msg to function 'client_envadd' in DHCP-4.3.3 |
Date: | Fri, 27 Nov 2015 18:26:29 +0000 |
To: | dhcp-bugs@isc.org |
From: | "Bill Parker" <wp02855@gmail.com> |
Bug Report from www.isc.org:
Name: Bill Parker
Email: wp02855@gmail.com
Software Version: DHCP 4.3.x
OS: Linux/Unix/MacOS/All
Subject:Add log_error msg to function 'client_envadd' in DHCP-4.3.3
Bug Detail
===========
Hello All,
In reviewing source code in dhcp-4.3.3, I found in sub-directory
'client', file 'dhclient.c', in function 'client_envadd', if dmalloc()
fails, the function simply returns, but in all other calls to dmalloc()
in this file, a log_error() or log_fatal() is sent. The patch file
below adds a log_error() for the dmalloc() in function 'client_envadd':
--- dhclient.c.orig 2015-11-26 10:12:36.222132191 -0800
+++ dhclient.c 2015-11-26 10:13:43.891732649 -0800
@@ -3578,8 +3578,10 @@
val = dmalloc (strlen (prefix) + strlen (name) + 1 /* = */ +
len + sizeof *val, MDL);
- if (!val)
+ if (!val) {
+ log_error ("No memory for client add environment.");
return;
+ }
s = val -> string;
strcpy (s, prefix);
strcat (s, name);
=======================================================================
In sub-directory 'common', file 'discovery.c', there is a call to
dmalloc() which simply returns in the event of failure in function
'interface_stash', but all other calls to dmalloc() have a(n) log_fatal
or log_error associated with them. The patch file below adds a 'log_error'
warning to function 'interface_stash':
--- discover.c.orig 2015-11-26 10:37:14.287986760 -0800
+++ discover.c 2015-11-26 10:39:07.579385515 -0800
@@ -1825,8 +1825,10 @@
delta = tptr -> index - interface_max + 10;
vec = dmalloc ((interface_max + delta) *
sizeof (struct interface_info *), MDL);
- if (!vec)
+ if (!vec) {
+ log_error("no space for interface stash.");
return;
+ }
memset (&vec [interface_max], 0,
(sizeof (struct interface_info *)) * delta);
interface_max += delta;
My question is, should this be treated as a 'log_fatal' rather than
simply returning?
=======================================================================
A 'make' of the above patch files results in a clean compile/build.
Bill Parker (wp02855 at gmail dot com)
---
This email was received through isc.org Bug Submission Form
All information within this email is considered confidential and for internal use only.