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

b07c2e
autofs-5.1.8 - fix loop under run in cache_get_offset_parent()
b07c2e
b07c2e
From: Frank Sorenson <sorenson@redhat.com>
b07c2e
b07c2e
To avoid reading memory outside of the the string
b07c2e
allocated for parent, tail needs to stop when it
b07c2e
reaches or passes parent, even if it doesn't
b07c2e
actually equal parent.
b07c2e
b07c2e
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
b07c2e
---
b07c2e
 CHANGELOG   |    1 +
b07c2e
 lib/cache.c |    2 +-
b07c2e
 2 files changed, 2 insertions(+), 1 deletion(-)
b07c2e
b07c2e
--- autofs-5.1.4.orig/CHANGELOG
b07c2e
+++ autofs-5.1.4/CHANGELOG
b07c2e
@@ -86,6 +86,7 @@
b07c2e
 - fix root offset error handling.
b07c2e
 - fix nonstrict fail handling of last offset mount.
b07c2e
 - dont fail on duplicate offset entry tree add.
b07c2e
+- fix loop under run in cache_get_offset_parent().
b07c2e
 
b07c2e
 xx/xx/2018 autofs-5.1.5
b07c2e
 - fix flag file permission.
b07c2e
--- autofs-5.1.4.orig/lib/cache.c
b07c2e
+++ autofs-5.1.4/lib/cache.c
b07c2e
@@ -680,7 +680,7 @@ struct mapent *cache_get_offset_parent(s
b07c2e
 		*tail = 0;
b07c2e
 
b07c2e
 		tail--;
b07c2e
-		if (tail == parent)
b07c2e
+		if (tail <= parent)
b07c2e
 			break;
b07c2e
 
b07c2e
 		me = cache_lookup_distinct(mc, parent);