diff options
| author | Robert Pluim | 2021-02-25 16:36:56 +0100 |
|---|---|---|
| committer | Robert Pluim | 2021-02-25 16:44:43 +0100 |
| commit | d84d69dfbc5f64e9020ce38d2cbd60fe39cb27b9 (patch) | |
| tree | aa9e6755690a84d810b40e01ff746072510d9d29 /src/gnutls.c | |
| parent | 6c5e86fc175f06a7d37649d4130cf39fc0702278 (diff) | |
| download | emacs-d84d69dfbc5f64e9020ce38d2cbd60fe39cb27b9.tar.gz emacs-d84d69dfbc5f64e9020ce38d2cbd60fe39cb27b9.zip | |
Don't crash if gnutls_handshake fails
In some situations involving Internet access not being fully
functional, gnutls_handshake returns a fatal error, which we were
ignoring, causing us to call gnutls_handshake again. Now we check for
the error and return it to the caller.
* src/gnutls.c (gnutls_try_handshake): Return immediately if
gnutls_handshake returns a fatal error (Bug#46709).
Diffstat (limited to 'src/gnutls.c')
| -rw-r--r-- | src/gnutls.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index aa245ee5c39..4d5a909db0d 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -625,6 +625,8 @@ gnutls_try_handshake (struct Lisp_Process *proc) | |||
| 625 | 625 | ||
| 626 | while ((ret = gnutls_handshake (state)) < 0) | 626 | while ((ret = gnutls_handshake (state)) < 0) |
| 627 | { | 627 | { |
| 628 | if (gnutls_error_is_fatal (ret)) | ||
| 629 | return emacs_gnutls_handle_error (state, ret); | ||
| 628 | do | 630 | do |
| 629 | ret = gnutls_handshake (state); | 631 | ret = gnutls_handshake (state); |
| 630 | while (ret == GNUTLS_E_INTERRUPTED); | 632 | while (ret == GNUTLS_E_INTERRUPTED); |