]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Correctly keep track of where we are in the quicserver request buffer
authorMatt Caswell <matt@openssl.org>
Thu, 27 Jul 2023 14:33:04 +0000 (15:33 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 2 Aug 2023 14:07:07 +0000 (15:07 +0100)
If the request comes in in multiple chunks properly keep tract of where
we are.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21578)

util/quicserver.c

index 42adee531cb5ff6eaf08bd5d92c803366c243eb8..d23d4f41665f513507def28e5fd929a42b2d94ca 100644 (file)
@@ -210,11 +210,11 @@ int main(int argc, char *argv[])
 
         ossl_quic_tserver_tick(qtserv);
 
-        if (ossl_quic_tserver_read(qtserv, 0, reqbuf, sizeof(reqbuf),
-                                    &numbytes)) {
-            if (numbytes > 0) {
-                fwrite(reqbuf, 1, numbytes, stdout);
-            }
+        if (ossl_quic_tserver_read(qtserv, 0, reqbuf + reqbytes,
+                                   sizeof(reqbuf) - reqbytes,
+                                   &numbytes)) {
+            if (numbytes > 0)
+                fwrite(reqbuf + reqbytes, 1, numbytes, stdout);
             reqbytes += numbytes;
         }
     } while (reqbytes < sizeof(reqterm)