]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Fixed an unchecked strdup in confpars.c
authorThomas Markwalder <tmark@isc.org>
Mon, 12 Oct 2015 11:10:24 +0000 (07:10 -0400)
committerThomas Markwalder <tmark@isc.org>
Mon, 12 Oct 2015 11:10:24 +0000 (07:10 -0400)
    Merged in 40823.

RELNOTES
server/confpars.c

index f5c020530703fa7fd0493f0f4bcf01d513e86223..db930e0a488c7e501b1ca2a2cfaf481face019ff 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -70,10 +70,12 @@ by Eric Young (eay@cryptsoft.com).
   and its ATF unit tests when failover is disabled.
   [ISC-Bugs #40372]
 
-- Fixed several potential null references.  Thanks to Bill Parker
-  (wp02855 at gmail dot com) who identified these issues and supplied
-  patches to address them.
+- Fixed several issues static analysis issues such as potential null
+  references, unchecked strdup returns.  Thanks to Bill Parker (wp02855 at
+  gmail dot com) who identified these issues and supplied patches to
+  address them.
   [ISC-Bugs #40754]
+  [ISC-Bugs #40823]
 
 - The linux packet filter code now correctly treats only least significant
   12 bits an inbound packet's TCI value as the VLAN id (per IEEE 802.1Q).
index 4b2907d41c41a8cca3111f4bed5535ef29abc721..42a1712d9f3a0a92b8b07378898328b3ae1bb4ea 100644 (file)
@@ -2687,7 +2687,13 @@ void parse_subnet_declaration (cfile, share)
        if (host_addr (subnet -> net, subnet -> netmask)) {
                char *maskstr;
 
+               /* dup it, since piaddr is re-entrant */
                maskstr = strdup (piaddr (subnet -> netmask));
+               if (maskstr == NULL) {
+                       log_fatal("Allocation of subnet maskstr failed: %s",
+                           piaddr (subnet -> net));
+               }
+
                parse_warn (cfile,
                   "subnet %s netmask %s: bad subnet number/mask combination.",
                            piaddr (subnet -> net), maskstr);