diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -464,6 +464,10 @@ get_long_basename (char * name, char * buf, int size) | |||
| 464 | HANDLE dir_handle; | 464 | HANDLE dir_handle; |
| 465 | int len = 0; | 465 | int len = 0; |
| 466 | 466 | ||
| 467 | /* must be valid filename, no wild cards or other illegal characters */ | ||
| 468 | if (strpbrk (name, "*?|<>\"")) | ||
| 469 | return 0; | ||
| 470 | |||
| 467 | dir_handle = FindFirstFile (name, &find_data); | 471 | dir_handle = FindFirstFile (name, &find_data); |
| 468 | if (dir_handle != INVALID_HANDLE_VALUE) | 472 | if (dir_handle != INVALID_HANDLE_VALUE) |
| 469 | { | 473 | { |
| @@ -1639,8 +1643,8 @@ stat (const char * path, struct stat * buf) | |||
| 1639 | } | 1643 | } |
| 1640 | 1644 | ||
| 1641 | name = (char *) map_w32_filename (path, &path); | 1645 | name = (char *) map_w32_filename (path, &path); |
| 1642 | /* must be valid filename, no wild cards */ | 1646 | /* must be valid filename, no wild cards or other illegal characters */ |
| 1643 | if (strchr (name, '*') || strchr (name, '?')) | 1647 | if (strpbrk (name, "*?|<>\"")) |
| 1644 | { | 1648 | { |
| 1645 | errno = ENOENT; | 1649 | errno = ENOENT; |
| 1646 | return -1; | 1650 | return -1; |