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

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