From: Roman Arutyunyan Date: Mon, 27 Apr 2026 05:40:16 +0000 (+0400) Subject: Mp4: avoid adding or comparing to null pointer X-Git-Tag: release-1.31.1~6 X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=18a70a4d5806b5578d00460493954262ece55019;p=nginx.git Mp4: avoid adding or comparing to null pointer It is considered undefined behavior. Reported by Geonwoo.kim (awo@kakao.com). --- diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c index 678d6296c..0ccdf135a 100644 --- a/src/http/modules/ngx_http_mp4_module.c +++ b/src/http/modules/ngx_http_mp4_module.c @@ -1063,7 +1063,9 @@ ngx_http_mp4_read(ngx_http_mp4_file_t *mp4, size_t size) { ssize_t n; - if (mp4->buffer_pos + size <= mp4->buffer_end) { + if (mp4->buffer_pos && mp4->buffer_end + && mp4->buffer_pos + size <= mp4->buffer_end) + { return NGX_OK; }