Skip to content

hls: check pool allocation results in ngx_rtmp_hls_publish#1803

Open
DmitryTD wants to merge 1 commit into
arut:masterfrom
DmitryTD:fix-hls-publish-ctx-null-check
Open

hls: check pool allocation results in ngx_rtmp_hls_publish#1803
DmitryTD wants to merge 1 commit into
arut:masterfrom
DmitryTD:fix-hls-publish-ctx-null-check

Conversation

@DmitryTD

Copy link
Copy Markdown

ngx_rtmp_hls_publish() allocates several buffers from the connection pool and dereferences the results without checking for NULL.

ngx_pcalloc()/ngx_palloc() can return NULL under memory pressure, which would lead to a NULL pointer dereference and a worker crash.

Add the missing NULL checks, returning NGX_ERROR on allocation failure.

The ngx_pcalloc()/ngx_palloc() results for the session context and the
playlist/stream path buffers were dereferenced without a NULL check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Mihalchenko <tascad@altlinux.org>
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.

1 participant