]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEV: h2: fix h2-tracer.lua nil value index
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 8 Apr 2025 15:36:49 +0000 (17:36 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 8 Apr 2025 15:44:41 +0000 (17:44 +0200)
commitafd5f5d671d52f2a5a1fb9df9d05bf29f90859b0
treeff60967861c30852ca45b321626a0c12b1361ee5
parentf4634e5a38b2c2cc48b095205dcbc138e2df4a23
DEV: h2: fix h2-tracer.lua nil value index

Nick Ramirez reported the following error while testing the h2-tracer.lua
script:

  Lua filter 'h2-tracer' : [state-id 0] runtime error: /etc/haproxy/h2-tracer.lua:227: attempt to index a nil value (field '?') from /etc/haproxy/h2-tracer.lua:227: in function line 109.

It is caused by h2ff indexing with an out of bound value. Indeed, h2ff
is indexed with the frame type, which can potentially be > 9 (not common
nor observed during Willy's tests), while h2ff only defines indexes from
0 to 9.

The fix was provided by Willy, it consists in skipping h2ff indexing if
frame type is > 9. It was confirmed that doing so fixes the error.
dev/h2/h2-tracer.lua