From 0f79f9afc0d5ddca53ffb115f582e76d3e4e3190 Mon Sep 17 00:00:00 2001 From: Dmitry Mihalchenko Date: Mon, 29 Jun 2026 16:25:56 +0300 Subject: [PATCH] cmd: check allocation result in NGX_RTMP_SET_STRPAR The connect command string parameters (app, args, flashver, ...) were copied into a pool allocation whose result was not checked for NULL. Return NGX_ERROR on failure. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Mihalchenko --- ngx_rtmp_cmd_module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ngx_rtmp_cmd_module.c b/ngx_rtmp_cmd_module.c index 13f6677a0..5a72ce016 100644 --- a/ngx_rtmp_cmd_module.c +++ b/ngx_rtmp_cmd_module.c @@ -275,6 +275,9 @@ ngx_rtmp_cmd_connect(ngx_rtmp_session_t *s, ngx_rtmp_connect_t *v) #define NGX_RTMP_SET_STRPAR(name) \ s->name.len = ngx_strlen(v->name); \ s->name.data = ngx_palloc(s->connection->pool, s->name.len); \ + if (s->name.data == NULL) { \ + return NGX_ERROR; \ + } \ ngx_memcpy(s->name.data, v->name, s->name.len) NGX_RTMP_SET_STRPAR(app);