community_copy needs to check if nentries is 0 and handle that specially.
authorclaudio <claudio@openbsd.org>
Tue, 10 Sep 2024 08:53:20 +0000 (08:53 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 10 Sep 2024 08:53:20 +0000 (08:53 +0000)
commit07ef39656b1ad87dc7dc7993bbd6ca5d77575ba0
treece9e27c7fa6a2950ae2697fd60e5d5a6e550f4ec
parente5e5eb1a03d668899235cbf0657e8e22d2e7bacf
community_copy needs to check if nentries is 0 and handle that specially.

Calling malloc / reallocarray with a 0 size is not portable and the
memcpy with a possible NULL pointer as source and 0 len is seen as UB
by newer C standards (grmbl).

OK tb@
usr.sbin/bgpd/rde_community.c