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

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