fix(net): add null checks after allocation in network code #150

Merged
OragonEfreet merged 1 commit from fix/net-null-checks into main 2026-06-03 20:01:47 +02:00
Owner

Add null checks after all bj_calloc() calls in both POSIX and Win32
network implementations. Previously, allocation failures would cause
null pointer dereferences. Now properly sets error and returns NULL,
with appropriate resource cleanup (closing sockets, freeing addrinfo).

Affected functions:

  • bj_resolve_address
  • bj_listen_tcp
  • bj_connect_tcp
  • bj_connect_tcp_to
  • bj_accept_tcp
  • bj_open_udp
  • bj_udp_recv
Add null checks after all bj_calloc() calls in both POSIX and Win32 network implementations. Previously, allocation failures would cause null pointer dereferences. Now properly sets error and returns NULL, with appropriate resource cleanup (closing sockets, freeing addrinfo). Affected functions: - bj_resolve_address - bj_listen_tcp - bj_connect_tcp - bj_connect_tcp_to - bj_accept_tcp - bj_open_udp - bj_udp_recv
fix(net): add null checks after allocation in network code
All checks were successful
Documentation / build-docs (pull_request) Successful in 8s
QA / cert (pull_request) Successful in 29s
Build and Test / linux-linux-gcc / shared (pull_request) Successful in 16s
Build and Test / linux-linux-gcc / static (pull_request) Successful in 17s
Build and Test / linux-windows-mingw / shared (pull_request) Successful in 26s
Build and Test / linux-windows-mingw / static (pull_request) Successful in 26s
2b79197c39
Add null checks after all bj_calloc() calls in both POSIX and Win32
network implementations. Previously, allocation failures would cause
null pointer dereferences. Now properly sets error and returns NULL,
with appropriate resource cleanup (closing sockets, freeing addrinfo).

Affected functions:
- bj_resolve_address
- bj_listen_tcp
- bj_connect_tcp
- bj_connect_tcp_to
- bj_accept_tcp
- bj_open_udp
- bj_udp_recv
OragonEfreet added this to the 1.0 milestone 2026-06-03 17:57:12 +02:00
OragonEfreet deleted branch fix/net-null-checks 2026-06-03 20:01:47 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
OragonEfreet/banjo!150
No description provided.