Blame SOURCES/autofs-5.1.8-avoid-calling-pthread_getspecific-with-NULL-key_thread_attempt_id.patch

b07c2e
autofs-5.1.8 - avoid calling pthread_getspecific() with NULL key_thread_attempt_id
b07c2e
b07c2e
From: Ian Kent <raven@themaw.net>
b07c2e
b07c2e
Don't call pthread_getspecific() if key_thread_attempt_id is NULL in
b07c2e
case the pthread_getspecific() implementation doesn't check for this.
b07c2e
b07c2e
Signed-off-by: Ian Kent <raven@themaw.net>
b07c2e
---
b07c2e
 CHANGELOG |    1 +
b07c2e
 lib/log.c |    3 +++
b07c2e
 2 files changed, 4 insertions(+)
b07c2e
b07c2e
--- autofs-5.1.4.orig/CHANGELOG
b07c2e
+++ autofs-5.1.4/CHANGELOG
b07c2e
@@ -90,6 +90,7 @@
b07c2e
 - simplify cache_add() a little.
b07c2e
 - fix use after free in tree_mapent_delete_offset_tree().
b07c2e
 - fix memory leak in xdr_exports().
b07c2e
+- avoid calling pthread_getspecific() with NULL key_thread_attempt_id.
b07c2e
 
b07c2e
 xx/xx/2018 autofs-5.1.5
b07c2e
 - fix flag file permission.
b07c2e
--- autofs-5.1.4.orig/lib/log.c
b07c2e
+++ autofs-5.1.4/lib/log.c
b07c2e
@@ -38,6 +38,9 @@ static char *prepare_attempt_prefix(cons
b07c2e
 	char buffer[ATTEMPT_ID_SIZE + 1];
b07c2e
 	char *prefixed_msg = NULL;
b07c2e
 
b07c2e
+	if (!key_thread_attempt_id)
b07c2e
+		return NULL;
b07c2e
+
b07c2e
 	attempt_id = pthread_getspecific(key_thread_attempt_id);
b07c2e
 	if (attempt_id) {
b07c2e
 		int len = sizeof(buffer) + 1 + strlen(msg) + 1;