diff options
author | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2022-01-27 18:47:47 +0300 |
---|---|---|
committer | Antenore Gatta (tmow) <antenore@simbiosi.org> | 2022-01-27 18:47:47 +0300 |
commit | 3c0190cf284b4ced7c3a00fa9da72e2103408ca0 (patch) | |
tree | 0dde1012a0fa1feb3afb045fc86d143d56a855b8 /src | |
parent | c6103e7c7d03c4da0720e34d519be79659884253 (diff) |
Fix buffer overflow and one-time clear text password
Diffstat (limited to 'src')
-rw-r--r-- | src/remmina_crypt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/remmina_crypt.c b/src/remmina_crypt.c index 0c9e02551..3d99fea75 100644 --- a/src/remmina_crypt.c +++ b/src/remmina_crypt.c @@ -148,12 +148,12 @@ gchar* remmina_crypt_decrypt(const gchar *str) buf = g_base64_decode(str, &buf_len); - /* +#if 0 g_debug ("%s base64 encoded as %p with length %lu", str, &buf, buf_len); - */ +#endif err = gcry_cipher_decrypt( hd, // gcry_cipher_hd_t @@ -168,13 +168,15 @@ gchar* remmina_crypt_decrypt(const gchar *str) gcry_strerror(err)); g_free(buf); gcry_cipher_close(hd); - return NULL; + //return NULL; + return g_strdup(str); } gcry_cipher_close(hd); /* Just in case */ - buf[buf_len - 1] = '\0'; + if (buf_len > 0) + buf[buf_len - 1] = '\0'; return (gchar*)buf; } |