]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: fix segfault on CONNECTION_CLOSE parsing
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 7 Dec 2021 14:32:00 +0000 (15:32 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 7 Dec 2021 14:37:53 +0000 (15:37 +0100)
At the moment the reason_phrase member of a
quic_connection_close/quic_connection_close_app structure is not
allocated. Comment the memcpy to it to avoid segfault.

src/quic_frame.c

index 7194e6fda390c5c28c7ea956a7b4aa256f9fa1c1..dfb6103fc5781fc5ac518e1b633002684b656367 100644 (file)
@@ -821,7 +821,8 @@ static int quic_build_connection_close_app_frame(unsigned char **buf, const unsi
                return 0;
 
        if (connection_close_app->reason_phrase_len) {
-               memcpy(*buf, connection_close_app->reason_phrase, connection_close_app->reason_phrase_len);
+               // TODO reason_phrase is not allocated
+               //memcpy(*buf, connection_close_app->reason_phrase, connection_close_app->reason_phrase_len);
                *buf += connection_close_app->reason_phrase_len;
        }
 
@@ -843,7 +844,8 @@ static int quic_parse_connection_close_app_frame(struct quic_frame *frm, struct
            end - *buf < connection_close_app->reason_phrase_len)
                return 0;
 
-       memcpy(connection_close_app->reason_phrase, *buf, connection_close_app->reason_phrase_len);
+       // TODO reason_phrase is not allocated
+       //memcpy(connection_close_app->reason_phrase, *buf, connection_close_app->reason_phrase_len);
        *buf += connection_close_app->reason_phrase_len;
 
        return 1;