[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/tzz/nettle 833f1a4: WIP: GnuTLS: use SAFE_ALLOCA a
From: |
Teodor Zlatanov |
Subject: |
[Emacs-diffs] scratch/tzz/nettle 833f1a4: WIP: GnuTLS: use SAFE_ALLOCA as suggested.1 |
Date: |
Mon, 17 Apr 2017 13:47:19 -0400 (EDT) |
branch: scratch/tzz/nettle
commit 833f1a411e938aa0e18faf1df015103f902eb737
Author: Ted Zlatanov <address@hidden>
Commit: Ted Zlatanov <address@hidden>
WIP: GnuTLS: use SAFE_ALLOCA as suggested.1
---
src/gnutls.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gnutls.c b/src/gnutls.c
index 281fbe0..ea17148 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1822,7 +1822,7 @@ gnutls_symmetric_aead (bool encrypting,
gnutls_cipher_algorithm_t gca,
if (ret < GNUTLS_E_SUCCESS)
{
memset (storage, 0, storage_length);
- xfree (storage);
+ SAFE_FREE ();
gnutls_aead_cipher_deinit (acipher);
const char* str = gnutls_strerror (ret);
if (!str)
@@ -1836,8 +1836,9 @@ gnutls_symmetric_aead (bool encrypting,
gnutls_cipher_algorithm_t gca,
// TODO: switch this to use a resize_string_data() function when
// that's provided in the C core, to avoid the extra copy.
- Lisp_Object output = make_unibyte_string (storage, storage_length);
+ Lisp_Object output = make_unibyte_string ((const char *)storage,
storage_length);
memset (storage, 0, storage_length);
+ SAFE_FREE ();
return output;
#else
error ("GnuTLS AEAD cipher %ld was invalid or not found", (long) gca);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] scratch/tzz/nettle 833f1a4: WIP: GnuTLS: use SAFE_ALLOCA as suggested.1,
Teodor Zlatanov <=