Blame SOURCES/autofs-5.1.8-fix-loop-under-run-in-cache_get_offset_parent.patch

91594d
autofs-5.1.8 - fix loop under run in cache_get_offset_parent()
91594d
91594d
From: Frank Sorenson <sorenson@redhat.com>
91594d
91594d
To avoid reading memory outside of the the string
91594d
allocated for parent, tail needs to stop when it
91594d
reaches or passes parent, even if it doesn't
91594d
actually equal parent.
91594d
91594d
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
91594d
---
91594d
 CHANGELOG   |    1 +
91594d
 lib/cache.c |    2 +-
91594d
 2 files changed, 2 insertions(+), 1 deletion(-)
91594d
91594d
--- autofs-5.1.7.orig/CHANGELOG
91594d
+++ autofs-5.1.7/CHANGELOG
91594d
@@ -88,6 +88,7 @@
91594d
 - fix fix root offset error handling.
91594d
 - fix nonstrict fail handling of last offset mount.
91594d
 - dont fail on duplicate offset entry tree add.
91594d
+- fix loop under run in cache_get_offset_parent().
91594d
 
91594d
 25/01/2021 autofs-5.1.7
91594d
 - make bind mounts propagation slave by default.
91594d
--- autofs-5.1.7.orig/lib/cache.c
91594d
+++ autofs-5.1.7/lib/cache.c
91594d
@@ -710,7 +710,7 @@ struct mapent *cache_get_offset_parent(s
91594d
 		*tail = 0;
91594d
 
91594d
 		tail--;
91594d
-		if (tail == parent)
91594d
+		if (tail <= parent)
91594d
 			break;
91594d
 
91594d
 		me = cache_lookup_distinct(mc, parent);