named-checkconf crashes in name.c
Found by the AFL fuzzer. The attached file contains a number of configuration files, all of which cause named-checkconf (and named, should it be started with one of the configuration files) to crash with the following stack trace:
name.c:660: REQUIRE((__builtin_expect(!!((name1) != ((void *)0)), 1) && __builtin_expect(!!(((const isc__magic_t *)(name1))->magic == ((('D') << 24 | ('N') << 16 | ('S') << 8 | ('n')))), 1))) failed, back trace
#0 0x592654 in default_callback()+0x34
#1 0x5925ba in isc_assertion_failed()+0xa
#2 0x45e7ea in dns_name_equal()+0x17a
#3 0x439f54 in check_zoneconf()+0x1814
#4 0x43c4af in check_viewconf()+0x19f
#5 0x43f283 in bind9_check_namedconf()+0x1013
#6 0x4337a9 in main()+0x359
#7 0x7f2552857fea in __do_global_dtors_aux_fini_array_entry()+0x7f2552008592
#8 0x433aca in _start()+0x2a
Aborted
The issue is reproducible in the current version of master (commit d844959a).
Edited by Stephen Morris