]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: qpack: abort on dynamic index field line decoding
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 20 Jun 2022 13:47:46 +0000 (15:47 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 20 Jun 2022 13:56:01 +0000 (15:56 +0200)
Add an ABORT_NOW() clause if indexed field line referred to the dynamic
table. This is required as current haproxy QPACK implementation does not
support the dynamic table.

Note that this should not happen as haproxy explicitely advertizes a
null-sized dynamic table to the other peer.

This shoud fix github issue #1753.

No need to backport as this was introduced by commit
  b666c6b26eae3f17eee058eb6bcc9fe1b1c304d2
  MINOR: qpack: improve decoding function

src/qpack-dec.c

index bb960b4b9440c217a98dca891efdbb8ff1ea069f..09ec66d675b4cebe35ad17faaafae3e722da5ecc 100644 (file)
@@ -289,10 +289,10 @@ int qpack_decode_fs(const unsigned char *raw, size_t len, struct buffer *tmp,
                else if (efl_type & QPACK_IFL_BIT) {
                        /* Indexed field line */
                        uint64_t index;
-                       unsigned int t;
+                       unsigned int static_tbl;
 
                        qpack_debug_printf(stderr, "indexed field line:");
-                       t = efl_type & 0x40;
+                       static_tbl = efl_type & 0x40;
                        index = qpack_get_varint(&raw, &len, 6);
                        if (len == (uint64_t)-1) {
                                qpack_debug_printf(stderr, "##ERR@%d\n", __LINE__);
@@ -300,10 +300,19 @@ int qpack_decode_fs(const unsigned char *raw, size_t len, struct buffer *tmp,
                                goto out;
                        }
 
-                       if (t) {
+                       if (static_tbl) {
                                name = qpack_sht[index].n;
                                value = qpack_sht[index].v;
                        }
+                       else {
+                               /* TODO not implemented
+                                *
+                                * For the moment, this should never happen as
+                                * currently we do not support dynamic table insertion
+                                * and specify an empty table size.
+                                */
+                               ABORT_NOW();
+                       }
 
                        qpack_debug_printf(stderr,  " t=%d index=%llu", !!t, (unsigned long long)index);
                }