projects
/
claws.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a wrapper function to decode base64, returning a null-terminated string.
[claws.git]
/
src
/
common
/
smtp.c
diff --git
a/src/common/smtp.c
b/src/common/smtp.c
index e83a995ef34a6fed2c750f1d37707aa6481cb2da..a68083664d91bce562b7ac729c931ed119cc1fa6 100644
(file)
--- a/
src/common/smtp.c
+++ b/
src/common/smtp.c
@@
-218,13
+218,11
@@
static gint smtp_auth_recv(SMTPSession *session, const gchar *msg)
if (!strncmp(msg, "334 ", 4)) {
gchar *response;
gchar *response64;
if (!strncmp(msg, "334 ", 4)) {
gchar *response;
gchar *response64;
- gchar *challenge
, *tmp
;
+ gchar *challenge;
gsize challengelen;
guchar hexdigest[33];
gsize challengelen;
guchar hexdigest[33];
- tmp = g_base64_decode(msg + 4, &challengelen);
- challenge = g_strndup(tmp, challengelen);
- g_free(tmp);
+ challenge = g_base64_decode_zero(msg + 4, &challengelen);
log_print(LOG_PROTOCOL, "ESMTP< [Decoded: %s]\n", challenge);
g_snprintf(buf, sizeof(buf), "%s", session->pass);
log_print(LOG_PROTOCOL, "ESMTP< [Decoded: %s]\n", challenge);
g_snprintf(buf, sizeof(buf), "%s", session->pass);