Blame SOURCES/autofs-5.1.2-fix-possible-NULL-derefernce.patch

4d476f
autofs-5.1.2 - fix possible NULL derefernce
4d476f
4d476f
From: Ian Kent <raven@themaw.net>
4d476f
4d476f
In modules/mount_autofs.c:mount_mount() a NULL pointer dereference is
4d476f
(unlikley but) possible.
4d476f
4d476f
Signed-off-by: Ian Kent <raven@themaw.net>
4d476f
---
4d476f
 CHANGELOG              |    1 +
4d476f
 modules/mount_autofs.c |   15 +++++++++------
4d476f
 2 files changed, 10 insertions(+), 6 deletions(-)
4d476f
4d476f
--- autofs-5.0.7.orig/CHANGELOG
4d476f
+++ autofs-5.0.7/CHANGELOG
4d476f
@@ -243,6 +243,7 @@
4d476f
 - work around sss startup delay.
4d476f
 - add sss master map wait config option.
4d476f
 - use autofs_point to store expire timeout where possibe.
4d476f
+- fix possible NULL derefernce.
4d476f
 
4d476f
 25/07/2012 autofs-5.0.7
4d476f
 =======================
4d476f
--- autofs-5.0.7.orig/modules/mount_autofs.c
4d476f
+++ autofs-5.0.7/modules/mount_autofs.c
4d476f
@@ -280,13 +280,16 @@ int mount_mount(struct autofs_point *ap,
4d476f
 
4d476f
 	if (source->flags & MAP_FLAG_FORMAT_AMD) {
4d476f
 		struct amd_entry *am_entry = __master_find_amdmount(ap, entry->path);
4d476f
-		if (am_entry && am_entry->pref) {
4d476f
-			nap->pref = am_entry->pref;
4d476f
-			am_entry->pref = NULL;
4d476f
-		}
4d476f
 
4d476f
-		if (am_entry->cache_opts & AMD_CACHE_OPTION_ALL)
4d476f
-			nap->flags |= MOUNT_FLAG_AMD_CACHE_ALL;
4d476f
+		if (am_entry) {
4d476f
+			if (am_entry->pref) {
4d476f
+				nap->pref = am_entry->pref;
4d476f
+				am_entry->pref = NULL;
4d476f
+			}
4d476f
+
4d476f
+			if (am_entry->cache_opts & AMD_CACHE_OPTION_ALL)
4d476f
+				nap->flags |= MOUNT_FLAG_AMD_CACHE_ALL;
4d476f
+		}
4d476f
 	}
4d476f
 
4d476f
 	if (handle_mounts_startup_cond_init(&suc)) {