]> git.kaiwu.me - haproxy.git/commit
REGTESTS: protobuf: cover the ungrpc message realignment
authorOwais Lone <thesecguy45@gmail.com>
Tue, 3 Nov 2026 10:29:01 +0000 (10:29 +0000)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 5 Nov 2026 08:58:36 +0000 (09:58 +0100)
commitc923b3b4e407b0a587d1e926ecb8a1659ba38ed5
treed844e7b6fbf29bb59c059cccc1a778b9c5b40f07
parenta904dfcb4ebe1ba522f3cdecb33ac378448b8e46
REGTESTS: protobuf: cover the ungrpc message realignment

Regression test for 3a319e14c ("BUG/MINOR: sample: realign the ungrpc
converter on message boundaries").

grpc.vtc already walks a body of two gRPC messages, but the lookup
succeeds in its first message, so the cursor is left at the message end
and the bug does not show: that file passes both before and after the
fix. Reaching the defect needs a lookup that fails part-way through the
first message, which a length-delimited field whose wire type does not
match the requested one produces.

The body is 23 bytes and holds field 1 twice: length-delimited in the
first message, with a payload that reads as a gRPC header once the
cursor is misaligned, and as a varint 9999 in the second one.
ungrpc(1,int64) must return 9999. Before the fix it returned 1337, a
field of no message of the body.

Checked against 3a319e14c (passes) and its parent 1f114e4c4 (fails,
returning 1337).
reg-tests/protobuf/ungrpc_realign.vtc [new file with mode: 0644]