Blob Blame History Raw
autofs-5.1.2 - fix invalid reference in remount_active_mount()

From: Ian Kent <raven@themaw.net>

remount_active_mount() can be called with the map entry pointer NULL
so it must be checked before use when getting the automount timeout.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG    |    1 +
 lib/mounts.c |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

--- autofs-5.0.7.orig/lib/mounts.c
+++ autofs-5.0.7/lib/mounts.c
@@ -1721,8 +1721,10 @@ static int remount_active_mount(struct a
 	if (fd == -1)
 		return REMOUNT_OPEN_FAIL;
 
-	error(ap->logopt, "ap->type %d type %u", ap->type, type);
-	timeout = get_exp_timeout(ap, me->source);
+	if (!me)
+		timeout = get_exp_timeout(ap, NULL);
+	else
+		timeout = get_exp_timeout(ap, me->source);
 
 	/* Re-reading the map, set timeout and return */
 	if (ap->state == ST_READMAP) {
--- autofs-5.0.7.orig/CHANGELOG
+++ autofs-5.0.7/CHANGELOG
@@ -246,6 +246,7 @@
 - fix possible NULL derefernce.
 - fix work around sss startup delay.
 - improve scalability of direct mount path component.
+- fix invalid reference in remount_active_mount().
 
 25/07/2012 autofs-5.0.7
 =======================