Blame SOURCES/autofs-5.1.4-add-NULL-check-in-prepare_attempt_prefix.patch

85ad07
autofs-5.1.4 - add NULL check in prepare_attempt_prefix()
85ad07
85ad07
From: Ian Kent <raven@themaw.net>
85ad07
85ad07
prepare_attempt_prefix() calls calloc(3) and continues without
85ad07
checking if the allocation succeeded.
85ad07
85ad07
Signed-off-by: Ian Kent <raven@themaw.net>
85ad07
---
85ad07
 CHANGELOG |    1 +
85ad07
 lib/log.c |    2 ++
85ad07
 2 files changed, 3 insertions(+)
85ad07
85ad07
--- autofs-5.0.7.orig/CHANGELOG
85ad07
+++ autofs-5.0.7/CHANGELOG
85ad07
@@ -311,6 +311,7 @@
85ad07
 - add master map pseudo options for mount propagation.
85ad07
 - fix amd parser opts option handling.
85ad07
 - fix incorrect locking in sss lookup.
85ad07
+- add NULL check in prepare_attempt_prefix().
85ad07
 
85ad07
 25/07/2012 autofs-5.0.7
85ad07
 =======================
85ad07
--- autofs-5.0.7.orig/lib/log.c
85ad07
+++ autofs-5.0.7/lib/log.c
85ad07
@@ -44,6 +44,8 @@ static char *prepare_attempt_prefix(cons
85ad07
 
85ad07
 		snprintf(buffer, ATTEMPT_ID_SIZE, "%02lx", *attempt_id);
85ad07
 		prefixed_msg = (char *) calloc(len, sizeof(char));
85ad07
+		if (!prefixed_msg)
85ad07
+			return NULL;
85ad07
 		strcpy(prefixed_msg, buffer);
85ad07
 		strcat(prefixed_msg, "|");
85ad07
 		strcat(prefixed_msg, msg);