Skip to content

codec: check codec context allocation#1806

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

codec: check codec context allocation#1806
DmitryTD wants to merge 1 commit into
arut:masterfrom
DmitryTD:fix-codec-ctx-null-check

Conversation

@DmitryTD

Copy link
Copy Markdown

ngx_rtmp_codec_av() and ngx_rtmp_codec_meta_data() allocate the per-session codec context from the connection pool and dereference the result without checking for NULL.

ngx_pcalloc() 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 per-session codec context allocated with ngx_pcalloc() was
dereferenced without a NULL check in ngx_rtmp_codec_av() and
ngx_rtmp_codec_meta_data(). Return NGX_ERROR on failure.

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