]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: qpack: do not encode invalid http status code
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 30 Sep 2021 12:47:32 +0000 (14:47 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 8 Oct 2021 13:28:35 +0000 (15:28 +0200)
Ensure that the HTTP status code is valid before encoding with QPACK. An
error is return if this is not the case.

src/qpack-enc.c

index f53de7cb50ae779cf43e5277ecc719a86f765962..4d08836e0dad42c136278579434f44bf17e8e9d7 100644 (file)
@@ -54,6 +54,9 @@ int qpack_encode_int_status(struct buffer *out, unsigned int status)
 {
        int status_size, idx = 0;
 
+       if (status < 100 || status > 599)
+               return 1;
+
        switch (status) {
        case 103: idx = 24; break;
        case 200: idx = 25; break;