From 0b81e99ddfb01746e667797dedc291fc550d14d3 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 28 Nov 2001 21:44:19 +0000 Subject: [PATCH] 1144. [bug] rndc-confgen would crash if both the -a and -t options were specified. [RT #2159] --- CHANGES | 3 +++ bin/rndc/rndc-confgen.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index b648d1bb0d..4c698e5778 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1144. [bug] rndc-confgen would crash if both the -a and -t + options were specified. [RT #2159] + 1143. [bug] When a trusted-keys statement was present and named was built without crypto support, it would leak memory. diff --git a/bin/rndc/rndc-confgen.c b/bin/rndc/rndc-confgen.c index 00427fce7e..3084004d05 100644 --- a/bin/rndc/rndc-confgen.c +++ b/bin/rndc/rndc-confgen.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc-confgen.c,v 1.12 2001/11/27 20:59:52 gson Exp $ */ +/* $Id: rndc-confgen.c,v 1.13 2001/11/28 21:44:19 bwelling Exp $ */ #include @@ -280,8 +280,9 @@ main(int argc, char **argv) { char *buf; len = strlen(chrootdir) + strlen(keyfile) + 2; buf = isc_mem_get(mctx, len); - if (buf != NULL) { - fprintf(stderr, "isc_mem_get(%d) failed\n", len); + if (buf == NULL) { + fprintf(stderr, "isc_mem_get(%d) failed\n", + len); goto cleanup; } snprintf(buf, len, "%s/%s", chrootdir, keyfile);