Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 101

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

---
 modules/lookup_yp.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- autofs-5.0.1.orig/modules/lookup_yp.c
+++ autofs-5.0.1/modules/lookup_yp.c
@@ -168,6 +168,14 @@ int yp_all_master_callback(int status, c
 	if (status != YP_TRUE)
 		return status;
 
+	/* Ignore zero length and single non-printable char keys */
+	if (ypkeylen == 0 || (ypkeylen == 1 && !isprint(*ypkey))) {
+		warn(logopt, MODPREFIX
+		     "ignoring invalid map entry, zero length or "
+		     "single character non-printable key"); 
+		return 0;
+	}
+
 	/*
 	 * Ignore keys beginning with '+' as plus map
 	 * inclusion is only valid in file maps.
@@ -263,6 +271,14 @@ int yp_all_callback(int status, char *yp
 	if (status != YP_TRUE)
 		return status;
 
+	/* Ignore zero length and single non-printable char keys */
+	if (ypkeylen == 0 || (ypkeylen == 1 && !isprint(*ypkey))) {
+		warn(logopt, MODPREFIX
+		     "ignoring invalid map entry, zero length or "
+		     "single character non-printable key"); 
+		return 0;
+	}
+
 	/*
 	 * Ignore keys beginning with '+' as plus map
 	 * inclusion is only valid in file maps.