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

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