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

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