]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ngtcp2: fix early return
authorStefan Eissing <stefan@eissing.org>
Thu, 25 Sep 2025 10:07:25 +0000 (12:07 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Sep 2025 12:09:15 +0000 (14:09 +0200)
On a failed tls handshake, the receive function returned without
restoring the current data.

Reported in Joshua's sarif data

Closes #18723

lib/vquic/curl_ngtcp2.c

index 0e05694992a0d24a511b6cc9dbe4ec675ee3fe2e..4998400d96aacedc7c916cadffe27038a6c2284c 100644 (file)
@@ -1303,8 +1303,10 @@ static CURLcode cf_ngtcp2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
   *pnread = 0;
 
   /* handshake verification failed in callback, do not recv anything */
-  if(ctx->tls_vrfy_result)
-    return ctx->tls_vrfy_result;
+  if(ctx->tls_vrfy_result) {
+    result = ctx->tls_vrfy_result;
+    goto out;
+  }
 
   pktx_init(&pktx, cf, data);