BUG/MINOR: compression: Add OOM check for calloc() in parse_compression_options()
authorAlexander Stephan <alexander.stephan@sap.com>
Mon, 1 Sep 2025 09:57:51 +0000 (09:57 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Oct 2025 14:48:34 +0000 (16:48 +0200)
commit5050879023c3986fe997a03443d466e111e35ca1
tree08958096c2c80ff1388c1b8f2c21ade823f46433
parent6d1ee1bc20defb8807728bda9e02927d25d46739
BUG/MINOR: compression: Add OOM check for calloc() in parse_compression_options()

This patch adds a missing out-of-memory (OOM) check after
the call to `calloc()` in `parse_compression_options()`. If
memory allocation fails, an error message is set, the function
returns -1, and parsing is aborted to ensure safe handling
of low-memory conditions.

Co-authored-by: Christian Norbert Menges <christian.norbert.menges@sap.com>
(cherry picked from commit aa20905ac9e45c6caa8929f4686020708209e2bf)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e39edf65b0076a106a4475d73e3496df809f44ef)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 077efc51806cf6b65b26371fcb972ef8dff60869)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/flt_http_comp.c