In trace_htx_hexdump(), the remaining length to dump was decremented by
the length of the block value instead of the block size. But the length
is expressed in bytes of the HTX message. For a block without value or
with a value smaller than the block itself, like a NOOP block, the length
was not decremented accordingly and the dump could go beyond the
forwarded data. For instance, with a NOOP block in the middle of the
payload, one extra byte of the next DATA block was dumped.
Now the whole block size, minus the offset, is consumed.
This patch must be backported to 3.5.
continue;
}
+ /* <len> is a number of bytes in the HTX message, so the whole
+ * block size must be consumed, whatever the length of its value
+ * (e.g. NOOP blocks have no value but a size of 1 byte).
+ */
+ sz -= offset;
+ if (sz > len)
+ sz = len;
+ len -= sz;
+
v = htx_get_blk_value(htx, blk);
v = istadv(v, offset);
offset = 0;
-
- v = isttrim(v, len);
- len -= v.len;
+ v = isttrim(v, sz);
if (htx_is_data_type(type))
trace_hexdump(v);
}