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

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