-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
CRITICALNeeds Fixing ASAPNeeds Fixing ASAP
Description
Critical: Missing NULL Checks for Buffer Allocations
Priority: CRITICAL
Type: Memory Safety
Location
libwsv5.c line 1772-1775 in obsws_connect()
Issue
Buffer allocations are not checked for NULL before use:
conn->recv_buffer_size = OBSWS_DEFAULT_BUFFER_SIZE;
conn->recv_buffer = malloc(conn->recv_buffer_size); // ← NO CHECK!
conn->send_buffer_size = OBSWS_DEFAULT_BUFFER_SIZE;
conn->send_buffer = malloc(conn->send_buffer_size); // ← NO CHECK!Impact
If malloc fails (out of memory):
recv_bufferorsend_bufferwill be NULL- Later operations will dereference NULL → crash
- No graceful error handling
Note: Should also check the lws_context and wsi allocations later in the function for consistency.
Metadata
Metadata
Assignees
Labels
CRITICALNeeds Fixing ASAPNeeds Fixing ASAP