Skip to content

sip_parser: fail closed if the message separator cannot be allocated#328

Open
garacil wants to merge 1 commit into
freeswitch:masterfrom
garacil:fix-312-separator-null
Open

sip_parser: fail closed if the message separator cannot be allocated#328
garacil wants to merge 1 commit into
freeswitch:masterfrom
garacil:fix-312-separator-null

Conversation

@garacil

@garacil garacil commented Jul 5, 2026

Copy link
Copy Markdown

sip_complete_message() created the trailing message separator with sip_separator_create() but never checked the result before the multipart path dereferences sip->sip_separator->sep_common. If the allocation fails the separator stays NULL and the message is dereferenced through a NULL pointer.

This returns -1 — the function's existing error contract — when the separator cannot be allocated, fail-closed before any dereference. No behavior change on the success path; no ABI/API impact.

Fixes #312.

sip_complete_message() created the trailing separator with
sip_separator_create() but never checked the result before the multipart
path dereferences sip->sip_separator->sep_common. If the allocation fails
the separator stays NULL and the message is dereferenced through a NULL
pointer. Return -1 (the function's existing error contract) when the
separator cannot be allocated.

Fixes freeswitch#312.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Protential Null Pointer Dereference in sip_parser.c

1 participant