From: Matt Caswell Date: Thu, 27 Jul 2023 14:33:04 +0000 (+0100) Subject: Correctly keep track of where we are in the quicserver request buffer X-Git-Tag: openssl-3.2.0-alpha1~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=747b51f48338e3b7e53d0b7a87002edefc7e8439;p=thirdparty%2Fopenssl.git Correctly keep track of where we are in the quicserver request buffer If the request comes in in multiple chunks properly keep tract of where we are. Reviewed-by: Tomas Mraz Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/21578) --- diff --git a/util/quicserver.c b/util/quicserver.c index 42adee531cb..d23d4f41665 100644 --- a/util/quicserver.c +++ b/util/quicserver.c @@ -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)