Blame SOURCES/autofs-5.1.2-fix-short-memory-allocation-in-lookup_amd_instance.patch

304803
autofs-5.1.2 - fix short memory allocation in lookup_amd_instance()
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Fix off by one memory allocation size in lookup_amd_instance().
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG       |    1 +
304803
 daemon/lookup.c |    2 +-
304803
 2 files changed, 2 insertions(+), 1 deletion(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -218,6 +218,7 @@
304803
 - check NFS server availability on local mount fallback.
304803
 - honor last rw in mount options when doing a bind mount.
304803
 - update and add README for old autofs schema.
304803
+- fix short memory allocation in lookup_amd_instance().
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/daemon/lookup.c
304803
+++ autofs-5.0.7/daemon/lookup.c
304803
@@ -802,7 +802,7 @@ static int lookup_amd_instance(struct au
304803
 		return NSS_STATUS_UNKNOWN;
304803
 	}
304803
 
304803
-	m_key = malloc(strlen(ap->path) + strlen(me->multi->key) + 1);
304803
+	m_key = malloc(strlen(ap->path) + strlen(me->multi->key) + 2);
304803
 	if (!m_key) {
304803
 		error(ap->logopt,
304803
 		     "failed to allocate storage for search key");