mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +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:
parent
8fabaaa2a8
commit
3164e22f9b
1 changed files with 2 additions and 1 deletions
|
@ -312,7 +312,8 @@ KResultOr<size_t> IPv4Socket::receive_packet_buffered(OpenFileDescription& descr
|
||||||
m_receive_queue.size());
|
m_receive_queue.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!packet->data) {
|
|
||||||
|
if (!packet) {
|
||||||
if (protocol_is_disconnected()) {
|
if (protocol_is_disconnected()) {
|
||||||
dbgln("IPv4Socket({}) is protocol-disconnected, returning 0 in recvfrom!", this);
|
dbgln("IPv4Socket({}) is protocol-disconnected, returning 0 in recvfrom!", this);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue