[balsa/oauth2-support: 11/11] Merge remote-tracking branch 'origin/master' into oauth2-support




commit 4512b7e40c75d7ca8229bf2bdc393a101dd7fa4f
Merge: 8ad412cb4 c790155c9
Author: Albrecht Dreß <albrecht dress netcologne de>
Date:   Fri Jul 30 20:42:50 2021 +0200

    Merge remote-tracking branch 'origin/master' into oauth2-support

 libbalsa/libbalsa-gpgme.c      |   4 +
 libbalsa/mime.c                |  12 +-
 libbalsa/send.c                |  17 +-
 libnetclient/net-client-smtp.c |   6 +-
 po/POTFILES.in                 |   1 +
 po/pl.po                       | 675 +++++++++++++++++++++------------------
 po/pt_BR.po                    | 688 ++++++++++++++++++++++------------------
 po/sv.po                       | 527 +++++++++++++++++--------------
 po/uk.po                       | 694 ++++++++++++++++++++++-------------------
 9 files changed, 1434 insertions(+), 1190 deletions(-)
---
diff --cc libnetclient/net-client-smtp.c
index e25797fd8,7171a2fb2..6583a43c0
--- a/libnetclient/net-client-smtp.c
+++ b/libnetclient/net-client-smtp.c
@@@ -855,43 -653,36 +855,43 @@@ net_client_smtp_read_reply(NetClientSmt
        gboolean result;
  
        done = FALSE;
 -      rescode = expect_code;
        do {
                gchar *reply;
 +              GError *this_error = NULL;
  
 -              result = net_client_read_line(NET_CLIENT(client), &reply, error);
 +              result = net_client_read_line(NET_CLIENT(client), &reply, &this_error);
                if (result) {
                        gint this_rescode;
 -                      gchar *endptr;
  
 -                      this_rescode = strtol(reply, &endptr, 10);
 -                      if (rescode == -1) {
 -                              rescode = this_rescode;
 -                              result = net_client_smtp_eval_rescode(rescode, reply, error);
 -                      } else if (rescode != this_rescode) {
 -                              g_set_error(error, NET_CLIENT_SMTP_ERROR_QUARK, (gint) 
NET_CLIENT_ERROR_SMTP_PROTOCOL,
 -                                      _("bad server reply: %s"), reply);
 -                              result = FALSE;
 -                      } else {
 -                              /* nothing to do (see MISRA C:2012, Rule 15.7) */
 +                      this_rescode = strtol(reply, NULL, 10);
 +                      result = net_client_smtp_eval_rescode(this_rescode, expect_code, reply, &this_error);
 +
 +                      if (!result) {
 +                              if ((error != NULL) && (*error != NULL)) {
 +                                      g_prefix_error(&this_error, "%s ", (*error)->message);
 +                                      g_clear_error(error);
 +                              }
 +                              g_propagate_error(error, this_error);
                        }
 +
 +                      if (expect_code == -1) {
 +                              expect_code = this_rescode;
 +                      }
 +
-                       if (reply[3] == ' ') {
+                       if ((strlen(reply) > 3UL) && (reply[3] == ' ')) {
                                done = TRUE;
                                if (last_reply != NULL) {
                                        *last_reply = g_strdup(&reply[4]);
                                }
                        }
+ 
+                       g_free(reply);
 +              } else {
 +                      g_clear_error(error);
 +                      g_propagate_error(error, this_error);
 +                      done = TRUE;
                }
- 
-               g_free(reply);
 -      } while (result && !done);
 +      } while (!done);
  
        return result;
  }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]