resolved: do not try to copy empty NSEC types bitmaps
authorAlexander Tsoy <alexander@tsoy.me>
Mon, 28 Jun 2021 20:00:11 +0000 (23:00 +0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Jul 2021 15:59:39 +0000 (17:59 +0200)
commit3422b16ef9a85ab0a31558a68db67f148961d4a1
tree45456f04fd77ef9d9c8db9296760f0f77b2fbc89
parent7bdc7ff0bb2d1dde1a81b2cbc76e424d1c50b7aa
resolved: do not try to copy empty NSEC types bitmaps

dns_resource_record_copy() assumes that NSEC types bitmap is non-empty
which results in a null pointer dereference inside bitmap_copy() in some
cases. Fix this by calling bitmap_copy() conditionally.

(cherry picked from commit 1f00a50c695fe3b55dee38fbd02a902a6c703c87)
(cherry picked from commit fc7be6db131a5062dde76ee7857c2f91e1c402cb)
src/resolve/resolved-dns-rr.c