Commit Diff
Diff:
154de500285e095972cd25e03fd5f4e41781f9bd
75816c9aee57f332d95e9b4daf8632e78457b31b
Commit:
75816c9aee57f332d95e9b4daf8632e78457b31b
Tree:
bd56c323e7a64618a29ce317299e6feaf042fcba
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Tue Mar 10 10:04:46 2020 UTC
Message:
if tsigkey is not specified in an rzone it should not segfault now, it should imply NOKEY
blob - ee7a83fe75c8f0c1d56f71214c764c32af1b1858
blob + 52f695f8321389aa78dcdae3fa24c876caa77feb
--- raxfr.c
+++ raxfr.c
@@ -26,7 +26,7 @@
*
*/
/*
- * $Id: raxfr.c,v 1.49 2020/02/01 07:38:04 pjp Exp $
+ * $Id: raxfr.c,v 1.50 2020/03/10 10:04:46 pjp Exp $
*/
#include <sys/types.h>
@@ -1701,7 +1701,7 @@ get_remote_soa(struct rzone *rzone)
sa = (struct sockaddr *)&sin;
}
- if (strcmp(rzone->tsigkey, "NOKEY") != 0) {
+ if (rzone->tsigkey != NULL && strcmp(rzone->tsigkey, "NOKEY") != 0) {
keyname = dns_label(rzone->tsigkey, &keynamelen);
if (keyname == NULL) {
@@ -2103,7 +2103,7 @@ do_raxfr(FILE *f, struct rzone *rzone)
return -1;
}
- if (strcmp(rzone->tsigkey, "NOKEY") != 0) {
+ if (rzone->tsigkey != NULL && strcmp(rzone->tsigkey, "NOKEY") != 0) {
keyname = dns_label(rzone->tsigkey, &keynamelen);
if (keyname == NULL) {
dolog(LOG_ERR, "dns_label failed\n");
repomaster@centroid.eu