]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix up some issues found by static analysis
authorShawn Routhier <sar@isc.org>
Wed, 11 Apr 2012 15:43:34 +0000 (15:43 +0000)
committerShawn Routhier <sar@isc.org>
Wed, 11 Apr 2012 15:43:34 +0000 (15:43 +0000)
A potential memory leak and NULL dereference in omapi.
The use of a boolean test instead of a bitwise test in dst.
[ISC-Bugs #28941]

RELNOTES
dst/dst_api.c
omapip/protocol.c
server/confpars.c

index aca6a4da37100ffba5f8cedb94c5fa3ba54bda08..50536c834cffde1d1db06bfd250b9b2b31620b92 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -140,6 +140,11 @@ work on other platforms. Please report any problems and suggested fixes to
   Thanks to Jiri Popelka at Red Hat for the patch.
   [ISC-Bugs #22676]
 
+- Fix up some issues found by static analysis
+  A potential memory leak and NULL dereference in omapi.
+  The use of a boolean test instead of a bitwise test in dst.
+  [ISC-Bugs #28941]
+
                        Changes since 4.2.2
 
 - Fix the code that checks for an existing DDNS transaction to cancel
index 97bef9ed253b54f28a7a169ea68314c665e02d9a..0d18b61126ea30449424ad081130a293992cfb69 100644 (file)
@@ -1,10 +1,11 @@
 #ifndef LINT
-static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.9 2009/10/29 00:46:48 sar Exp $";
+static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.10 2012/04/11 15:43:34 sar Exp $";
 #endif
 
 /*
  * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
  * Portions Copyright (c) 2007,2009 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 2012 by Internet Systems Consortium, Inc. ("ISC")
  *
  * Permission to use, copy modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -342,7 +343,7 @@ dst_read_key(const char *in_keyname, const unsigned in_id,
                         in_alg));
                return (NULL);
        }
-       if ((type && (DST_PUBLIC | DST_PRIVATE)) == 0) 
+       if ((type & (DST_PUBLIC | DST_PRIVATE)) == 0) 
                return (NULL);
        if (in_keyname == NULL) {
                EREPORT(("dst_read_private_key(): Null key name passed in\n"));
index 1a6d7e871501d0981f905b40855639850fc9d855..990648980b7505a6ef99a2198c9217249bd48870 100644 (file)
@@ -3,7 +3,8 @@
    Functions supporting the object management protocol... */
 
 /*
- * Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009,2012 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1999-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -926,12 +927,10 @@ isc_result_t omapi_protocol_destroy (omapi_object_t *h,
                dfree (p -> default_auth, file, line);
 
        while (p -> remote_auth_list) {
-               omapi_remote_auth_t *r = p -> remote_auth_list -> next;
-               p -> remote_auth_list = r;
-               if (r) {
-                       omapi_object_dereference (&r -> a, file, line);
-                       dfree (r, file, line);
-               }
+               omapi_remote_auth_t *r = p -> remote_auth_list;
+               p -> remote_auth_list =  p -> remote_auth_list -> next;
+               omapi_object_dereference (&r -> a, file, line);
+               dfree (r, file, line);
        }
        return ISC_R_SUCCESS;
 }
index 64272b1b46433f5756e681b3d9f10f1da6b2df2e..1c9c48027e548a2c2d7377237ccc19565b82df0c 100644 (file)
@@ -2724,7 +2724,7 @@ void parse_group_declaration (cfile, group)
        enum dhcp_token token;
        struct group *g;
        int declaration = 0;
-       struct group_object *t;
+       struct group_object *t = NULL;
        isc_result_t status;
        char *name = NULL;
        int deletedp = 0;