s_client calls SSL_has_pending() even before the connection has been
established. We expect it to return 0 in this case and not put any errors
on the stack.
We change things so that SSL_has_pending() always returns 0 if there is
no stream available.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21578)
size_t avail = 0;
int fin = 0;
- if (!expect_quic_with_stream_lock(s, /*remote_init=*/-1, &ctx))
+
+ if (!expect_quic(s, &ctx))
return 0;
+ quic_lock(ctx.qc);
+
+ if (ctx.xso == NULL)
+ goto out;
+
if (ctx.xso->stream == NULL
|| !ossl_quic_stream_has_recv_buffer(ctx.xso->stream))
/* Cannot raise errors here because we are const, just fail. */