]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorBrian Wellington <source@isc.org>
Fri, 11 Aug 2000 02:13:03 +0000 (02:13 +0000)
committerBrian Wellington <source@isc.org>
Fri, 11 Aug 2000 02:13:03 +0000 (02:13 +0000)
 386.   [bug]           Missing strdup() of ACL name caused random
                        ACL matching failures [RT #228].

bin/named/aclconf.c

index 8c60b59e006a700e6705da9cac23aaeb63e44290..6c8d616351e83685de054c70b7d7eef4858a9586 100644 (file)
  * SOFTWARE.
  */
 
-/* $Id: aclconf.c,v 1.18 2000/06/22 21:54:17 tale Exp $ */
+/* $Id: aclconf.c,v 1.18.2.1 2000/08/11 02:13:02 bwelling Exp $ */
 
 #include <config.h>
 
+#include <isc/mem.h>
 #include <isc/string.h>                /* Required for HP/UX (and others?) */
 #include <isc/util.h>
 
@@ -61,7 +62,7 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx,
        {
                if (strcmp(aclname, dacl->name) == 0) {
                        dns_acl_attach(dacl, target);
-                       return ISC_R_SUCCESS;
+                       return (ISC_R_SUCCESS);
                }
        }
        /* Not yet converted.  Convert now. */
@@ -75,7 +76,9 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx,
        result = dns_acl_fromconfig(cacl->ipml, cctx, ctx, mctx, &dacl);
        if (result != ISC_R_SUCCESS)
                return (result);
-       dacl->name = aclname;
+       dacl->name = isc_mem_strdup(dacl->mctx, aclname);
+       if (dacl->name == NULL)
+               return (ISC_R_NOMEMORY);
        ISC_LIST_APPEND(ctx->named_acl_cache, dacl, nextincache);
        dns_acl_attach(dacl, target);
        return (ISC_R_SUCCESS);