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

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