]> git.ipfire.org Git - thirdparty/glibc.git/commit
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)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 25 Apr 2024 13:39:23 +0000 (15:39 +0200)
commit2ae9446c1b7a3064743b4a51c0bbae668ee43e4c
tree5316177e753b351aee616fbb4e2a20c3bb4d427f
parent541ea5172aa658c4bd5c6c6d6fd13903c3d5bb0a
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>
(cherry picked from commit b048a482f088e53144d26a61c390bed0210f49f2)
nscd/netgroupcache.c