]> git.ipfire.org Git - thirdparty/unbound.git/commit
edns-subnet: fix NULL_AFTER_DEREF on subnetmod (#1297)
authorKostya <68069182+bewflast@users.noreply.github.com>
Thu, 19 Jun 2025 14:24:21 +0000 (17:24 +0300)
committerGitHub <noreply@github.com>
Thu, 19 Jun 2025 14:24:21 +0000 (16:24 +0200)
commitd3f88d008fd0f9c991e76e88daf2594b7f47970e
treea4a4d4f5894d93ab33b2895c820573e6bcf2034d
parenta1d68cdc963857f23896dbd92720802efbbc7f04
edns-subnet: fix NULL_AFTER_DEREF on subnetmod (#1297)

Found by static analyzer svace.
Static analyzer message: Redundant comparison with a NULL value at subnetmod.c:236 for pointer 'sn_env->subnet_msg_cache',
which was dereferenced at slabhash.c:228 by passing as 1st parameter to function 'slabhash_setmarkdel' at subnetmod.c:235.

Moved usage of sn_env->subnet_msg_cache in slabhash_setmarkdel after checking.

Signed-off-by: Konstantin Kamanin <bewflast@gmail.com>
edns-subnet/subnetmod.c