[PATCH 13/37] autofs-5.1.2 - fix short memory allocation in lookup_amd_instance()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix off by one memory allocation size in lookup_amd_instance().

Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
 CHANGELOG       |    1 +
 daemon/lookup.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 28e857f..551443a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -12,6 +12,7 @@ xx/xx/2016 autofs-5.1.3
 - Remove unused local 2KB buffer.
 - Fix typos in error messages.
 - Fix fgets(3) size argument (another one).
+- fix short memory allocation in lookup_amd_instance().
 
 15/06/2016 autofs-5.1.2
 =======================
diff --git a/daemon/lookup.c b/daemon/lookup.c
index 201ccbb..582b5c9 100644
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -786,7 +786,7 @@ static int lookup_amd_instance(struct autofs_point *ap,
 		return NSS_STATUS_UNKNOWN;
 	}
 
-	m_key = malloc(strlen(ap->path) + strlen(me->multi->key) + 1);
+	m_key = malloc(strlen(ap->path) + strlen(me->multi->key) + 2);
 	if (!m_key) {
 		error(ap->logopt,
 		     "failed to allocate storage for search key");

--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux