CVE-2024-33600: nscd: Avoid null pointer crashes after notfound response (bug 31678)
authorFlorian Weimer <fweimer@redhat.com>
Thu, 25 Apr 2024 13:01:07 +0000 (15:01 +0200)
committerAdrian Bunk <bunk@debian.org>
Sat, 29 Jun 2024 10:27:34 +0000 (13:27 +0300)
commitd60203827a529508f2e878c7f140b38b0073a9d1
tree5fc67314ce0b341c1327ab7ed32fb62fa04362f9
parentff7799c8ef8654e81e7add5bc5203e2c6a61e3a8
CVE-2024-33600: nscd: Avoid null pointer crashes after notfound response (bug 31678)

The addgetnetgrentX call in addinnetgrX may have failed to produce
a result, so the result variable in addinnetgrX can be NULL.
Use db->negtimeout as the fallback value if there is no result data;
the timeout is also overwritten below.

Also avoid sending a second not-found response.  (The client
disconnects after receiving the first response, so the data stream did
not go out of sync even without this fix.)  It is still beneficial to
add the negative response to the mapping, so that the client can get
it from there in the future, instead of going through the socket.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Gbp-Pq: Topic all
Gbp-Pq: Name git-0003-CVE-2024-33600-nscd-Avoid-null-pointer-crashes-after.patch
nscd/netgroupcache.c