Skip to content

hls: check ngx_array_push() result in postconfiguration#1804

Open
DmitryTD wants to merge 1 commit into
arut:masterfrom
DmitryTD:fix-hls-postconf-event-push-check
Open

hls: check ngx_array_push() result in postconfiguration#1804
DmitryTD wants to merge 1 commit into
arut:masterfrom
DmitryTD:fix-hls-postconf-event-push-check

Conversation

@DmitryTD

Copy link
Copy Markdown

ngx_rtmp_hls_postconfiguration() registers event handlers via ngx_array_push() and dereferences the result without checking for NULL.

ngx_array_push() can return NULL on allocation failure, which would lead to a NULL pointer dereference.

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

The audio/video event handler slots were dereferenced without checking
the ngx_array_push() result for NULL, unlike the rest of nginx. 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