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

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