diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-06-24 16:53:56 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-06-24 16:53:56 +0000 |
| commit | 7c7c2476c148b4d0f2590e416218fb921f201fc5 (patch) | |
| tree | 18574ad1aaeec51c86f43cb2b8d74b76ef44a611 /methods/connect.cc | |
| parent | b0f13098c2e09555f878eea102d275acbcad6755 (diff) | |
| parent | 2c889aca1b3f792797753d73a94bc0c6f269f526 (diff) | |
Merge branch 'tls-closed-assertion' into 'main'
tls: Do not trigger assertion after closing connection
See merge request apt-team/apt!496
Diffstat (limited to 'methods/connect.cc')
| -rw-r--r-- | methods/connect.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/methods/connect.cc b/methods/connect.cc index 96c169e79..828be3f50 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -889,12 +889,11 @@ struct TlsFd final : public MethodFd bool HasPending() override { - assert(ssl); // SSL_has_pending() can return 1 even if there are no actual bytes to read // post decoding, so we need to SSL_peek() too to see if there are actual // bytes as otherwise we end up busy looping (tested by DE -> AU https connection) char buf; - return SSL_has_pending(ssl) && SSL_peek(ssl, &buf, 1) > 0; + return ssl != nullptr && SSL_has_pending(ssl) && SSL_peek(ssl, &buf, 1) > 0; } }; |
