1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

Kernel: Fix null dereference in IPv4Socket::receive_packet_buffered()

This was a mistake in the move away from KBuffer-as-a-value type.
We need to check `packet` here, not `packet->data`.

Regressed in b300f9aa2f.

Fixes #9888.
This commit is contained in:
Andreas Kling 2021-09-10 03:06:32 +02:00
parent 8fabaaa2a8
commit 3164e22f9b

View file

@ -312,7 +312,8 @@ KResultOr<size_t> IPv4Socket::receive_packet_buffered(OpenFileDescription& descr
m_receive_queue.size());
}
}
if (!packet->data) {
if (!packet) {
if (protocol_is_disconnected()) {
dbgln("IPv4Socket({}) is protocol-disconnected, returning 0 in recvfrom!", this);
return 0;