From www@isc.org Fri Nov 27 18:26:31 2015 MIME-Version: 1.0 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 X-Mailer: PHPMailer 5.2.10 (https://github.com/PHPMailer/PHPMailer/) content-type: text/plain; charset="utf-8" Message-ID: <9af9bc486a6e1508bf15e3c10a41f106@www.isc.org> Received: from mx.pao1.isc.org (mx.pao1.isc.org [IPv6:2001:4f8:0:2::2b]) by bugs.isc.org (Postfix) with ESMTP id 2A4C671B586 for ; Fri, 27 Nov 2015 18:26:31 +0000 (UTC) Received: from iscwebprod.isc.org (iscwebprod.isc.org [IPv6:2001:4f8:1:d::16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx.pao1.isc.org (Postfix) with ESMTPS id 9EFEB349431 for ; Fri, 27 Nov 2015 18:26:29 +0000 (UTC) Received: from www (uid 80) (envelope-from www@iscwebprod.isc.org) id 7b7d5e by iscwebprod.isc.org (DragonFly Mail Agent v0.9); Fri, 27 Nov 2015 18:26:29 +0000 Delivered-To: dhcp-bugs@bugs.isc.org Subject: DHCP 4.3.x - Add log_error msg to function 'client_envadd' in DHCP-4.3.3 Return-Path: X-Original-To: dhcp-bugs@bugs.isc.org X-Priority: 3 Date: Fri, 27 Nov 2015 18:26:29 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.pao1.isc.org X-PHP-Originating-Script: 20001:class-phpmailer.php To: dhcp-bugs@isc.org Content-Transfer-Encoding: 8bit From: "Bill Parker" X-RT-Original-Encoding: utf-8 X-RT-Interface: Email Content-Length: 2537 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.