Commit bb1584c8 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(stat, get_long_basename): Fail if filename contains any

characters that are illegal in file names.
parent 7d315986
......@@ -464,6 +464,10 @@ get_long_basename (char * name, char * buf, int size)
HANDLE dir_handle;
int len = 0;
/* must be valid filename, no wild cards or other illegal characters */
if (strpbrk (name, "*?|<>\""))
return 0;
dir_handle = FindFirstFile (name, &find_data);
if (dir_handle != INVALID_HANDLE_VALUE)
{
......@@ -1639,8 +1643,8 @@ stat (const char * path, struct stat * buf)
}
name = (char *) map_w32_filename (path, &path);
/* must be valid filename, no wild cards */
if (strchr (name, '*') || strchr (name, '?'))
/* must be valid filename, no wild cards or other illegal characters */
if (strpbrk (name, "*?|<>\""))
{
errno = ENOENT;
return -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment