ngtcp2: fix early return

On a failed tls handshake, the receive function returned without
restoring the current data.

Reported in Joshua's sarif data

Closes #18723
This commit is contained in:
Stefan Eissing 2025-09-25 12:07:25 +02:00 committed by Daniel Stenberg
parent b0f6593219
commit 5f4f70e06d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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);