File bind-CVE-2018-5745.patch of Package bind.19428
Index: bind-9.9.9-P1/lib/dns/include/dst/dst.h
===================================================================
--- bind-9.9.9-P1.orig/lib/dns/include/dst/dst.h
+++ bind-9.9.9-P1/lib/dns/include/dst/dst.h
@@ -71,8 +71,7 @@ typedef struct dst_context dst_context_
#define DST_ALG_HMACSHA512 165 /* XXXMPA */
#define DST_ALG_INDIRECT 252
#define DST_ALG_PRIVATE 254
-#define DST_ALG_EXPAND 255
-#define DST_MAX_ALGS 255
+#define DST_MAX_ALGS 256
/*% A buffer of this size is large enough to hold any key */
#define DST_KEY_MAXSIZE 1280
Index: bind-9.9.9-P1/lib/dns/zone.c
===================================================================
--- bind-9.9.9-P1.orig/lib/dns/zone.c
+++ bind-9.9.9-P1/lib/dns/zone.c
@@ -3400,9 +3400,10 @@ compute_tag(dns_name_t *name, dns_rdata_
dns_rdatatype_dnskey, dnskey, &buffer);
result = dns_dnssec_keyfromrdata(name, &rdata, mctx, &dstkey);
- if (result == ISC_R_SUCCESS)
+ if (result == ISC_R_SUCCESS) {
*tag = dst_key_id(dstkey);
- dst_key_free(&dstkey);
+ dst_key_free(&dstkey);
+ }
return (result);
}