kdig abort when query times out
Program aborts with a bad pointer free when a query times out on macOS.
kdig cloudflare.com @1.2.3.4
;; WARNING: response timeout for 1.2.3.4@53(UDP)
;; WARNING: response timeout for 1.2.3.4@53(UDP)
;; WARNING: response timeout for 1.2.3.4@53(UDP)
;; ERROR: failed to query server 1.2.3.4@53(UDP)
kdig(22551,0x109d69e00) malloc: *** error for object 0x7f9ba07045d0: pointer being freed was not allocated
kdig(22551,0x109d69e00) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort kdig cloudflare.com @1.2.3.4
Environment
macOS 11.5.1 Running commit 3d5007db (HEAD -> master, origin/master, origin/HEAD) Built with
gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Dynamic libraries:
otool -L $(which kdig)
/usr/local/bin/kdig:
/usr/local/opt/libidn2/lib/libidn2.0.dylib (compatibility version 4.0.0, current version 4.7.0)
/usr/local/opt/nghttp2/lib/libnghttp2.14.dylib (compatibility version 35.0.0, current version 35.2.0)
/usr/local/lib/libknot.12.dylib (compatibility version 13.0.0, current version 13.0.0)
/usr/local/lib/libdnssec.8.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/local/opt/lmdb/lib/liblmdb.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/gnutls/lib/libgnutls.30.dylib (compatibility version 59.0.0, current version 59.2.0)
/usr/lib/libedit.3.dylib (compatibility version 2.0.0, current version 3.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)