900526
diff -up bind-9.9.4/lib/dns/zone.c.CVE-2015-1349 bind-9.9.4/lib/dns/zone.c
900526
--- bind-9.9.4/lib/dns/zone.c.CVE-2015-1349	2015-03-02 11:18:36.138872044 +0100
900526
+++ bind-9.9.4/lib/dns/zone.c	2015-03-02 11:20:15.941032102 +0100
900526
@@ -8456,6 +8456,12 @@ keyfetch_done(isc_task_t *task, isc_even
900526
 					     namebuf, tag);
900526
 				trustkey = ISC_TRUE;
900526
 			}
900526
+		} else {
900526
+			/*
900526
+			 * No previously known key, and the key is not
900526
+			 * secure, so skip it.
900526
+			 */
900526
+			continue;
900526
 		}
900526
 
900526
 		/* Delete old version */
900526
@@ -8504,7 +8510,7 @@ keyfetch_done(isc_task_t *task, isc_even
900526
 			trust_key(zone, keyname, &dnskey, mctx);
900526
 		}
900526
 
900526
-		if (!deletekey)
900526
+		if (secure && !deletekey)
900526
 			set_refreshkeytimer(zone, &keydata, now);
900526
 	}
900526