]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: sample: fix host_only and port_only on empty input
authorGihyeon Ryu <rlgusryu@gmail.com>
Wed, 11 Nov 2026 10:00:12 +0000 (10:00 +0000)
committerOlivier Houchard <cognet@ci0.org>
Fri, 13 Nov 2026 15:55:27 +0000 (16:55 +0100)
commit42ef0b23e5e0761f1546a83ecc73c8035dc003a0
tree2a1903642d24a70a0bb3116241ff86daa3715e40
parent42daaf9575dc193872e54e9303b40d6e0735b555
BUG/MINOR: sample: fix host_only and port_only on empty input

sample_conv_host_only() and sample_conv_port_only() scan backwards from
area + data - 1. With an empty sample whose area is NULL, as returned by
req.body for a request without a body, this pointer is (char *)-1, the
first dereference faults and the worker dies (SIGSEGV, also in release
builds). A configuration applying these converters to req.body can thus
be stopped by a plain "GET /".

Both converters now return early on an empty input, with an empty string
and 0 respectively.

This should be backported to 2.8 and later.
src/sample.c