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

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