summaryrefslogtreecommitdiff
path: root/lib/includes/gnutls/gnutls.h.in
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-02-12 15:09:11 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2019-02-22 13:11:01 +0100
commitd39778e43d1674cb3ab3685157fd299816d535c0 (patch)
treee850b329e3b3b27f344aae980ad6159159ab8d93 /lib/includes/gnutls/gnutls.h.in
parentb4abf441ae1686fd602971dd0c0493a3c7e15fd1 (diff)
downloadgnutls-d39778e43d1674cb3ab3685157fd299816d535c0.tar.gz
Automatically NULLify after gnutls_free()
This method prevents direct use-after-free and double-free issues. Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'lib/includes/gnutls/gnutls.h.in')
-rw-r--r--lib/includes/gnutls/gnutls.h.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index 2965889664..eb808e40b4 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -2194,6 +2194,10 @@ extern _SYM_EXPORT gnutls_realloc_function gnutls_realloc;
extern _SYM_EXPORT gnutls_calloc_function gnutls_calloc;
extern _SYM_EXPORT gnutls_free_function gnutls_free;
+#ifdef GNUTLS_INTERNAL_BUILD
+#define gnutls_free(a) gnutls_free((void *) (a)), a=NULL
+#endif
+
extern _SYM_EXPORT char *(*gnutls_strdup) (const char *);
/* a variant of memset that doesn't get optimized out */