BUG/MINOR: quic: Missing incrementation in NEW_TOKEN frame builder
authorFrederic Lecaille <flecaille@haproxy.com>
Fri, 30 Aug 2024 12:25:26 +0000 (14:25 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 5 Sep 2024 14:18:52 +0000 (16:18 +0200)
quic_build_new_token_frame() is the function which is called to build
a NEW_TOKEN frame into a buffer. The position pointer for this buffer
was not updated, leading the NEW_TOKEN frame to be malformed.

Must be backported as far as 2.6.

(cherry picked from commit 76c80605a6cc7880e4184c52fb1a314367410271)
Signed-off-by: Frederic Lecaille <flecaille@haproxy.com>

src/quic_frame.c

index 41309db..8d42786 100644 (file)
@@ -485,6 +485,7 @@ static int quic_build_new_token_frame(unsigned char **pos, const unsigned char *
                return 0;
 
        memcpy(*pos, new_token_frm->data, new_token_frm->len);
+       *pos += new_token_frm->len;
 
        return 1;
 }