--- 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.