pullup:
386. [bug] Missing strdup() of ACL name caused random
ACL matching failures [RT #228].
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
386. [bug] Missing strdup() of ACL name caused random
|
||||
ACL matching failures [RT #228].
|
||||
|
||||
--- 9.0.0rc2 released ---
|
||||
|
||||
|
||||
+3
-1
@@ -15,7 +15,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: acl.c,v 1.11 2000/06/22 21:54:16 tale Exp $ */
|
||||
/* $Id: acl.c,v 1.11.2.1 2000/08/11 02:13:01 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -242,6 +242,8 @@ destroy(dns_acl_t *dacl) {
|
||||
if (dacl->elements != NULL)
|
||||
isc_mem_put(dacl->mctx, dacl->elements,
|
||||
dacl->alloc * sizeof(dns_aclelement_t));
|
||||
if (dacl->name != NULL)
|
||||
isc_mem_free(dacl->mctx, dacl->name);
|
||||
dacl->magic = 0;
|
||||
isc_mem_put(dacl->mctx, dacl, sizeof(*dacl));
|
||||
}
|
||||
|
||||
+6
-3
@@ -15,10 +15,11 @@
|
||||
* 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);
|
||||
|
||||
Reference in New Issue
Block a user