diff --git a/compat/memrchr.c b/compat/memrchr.c index 08a1dd036..88198d124 100644 --- a/compat/memrchr.c +++ b/compat/memrchr.c @@ -18,9 +18,6 @@ #include #include -#include -#include - /* * Reverse memchr() * Find the last occurrence of 'c' in the buffer 's' of size 'n'. diff --git a/plugins/sudoers/find_path.c b/plugins/sudoers/find_path.c index d98e2f7aa..2189f4425 100644 --- a/plugins/sudoers/find_path.c +++ b/plugins/sudoers/find_path.c @@ -122,7 +122,10 @@ find_path(infile, outfile, sbp, path) * Check current dir if dot was in the PATH */ if (!result && checkdot) { - result = sudo_goodpath(infile, sbp); + len = snprintf(command, sizeof(command), "./%s", infile); + if (len <= 0 || len >= sizeof(command)) + errorx(1, "%s: File name too long", infile); + result = sudo_goodpath(command, sbp); if (result && def_ignore_dot) return(NOT_FOUND_DOT); }