Annotation of /trunk/xdvdfs-tools/patches/xdvdfs-tools-2.1-fnamefix.patch
Parent Directory | Revision Log
Revision 153 -
(hide annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 677 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 677 byte(s)
-import
1 | niro | 153 | --- XDVDFS_Tools.orig/src/xdvdfs/xdvdfs.c 2003-08-15 23:26:58.000000000 +0000 |
2 | +++ XDVDFS_Tools/src/xdvdfs/xdvdfs.c 2005-05-21 12:13:55.655839216 +0000 | ||
3 | @@ -157,6 +157,14 @@ | ||
4 | memcpy(SearchRecord->Filename, Entry->Filename, Entry->FilenameLength); | ||
5 | SearchRecord->Filename[Entry->FilenameLength] = 0; | ||
6 | |||
7 | + if (strstr(SearchRecord->Filename,"..") || | ||
8 | + strchr(SearchRecord->Filename, '/') || | ||
9 | + strchr(SearchRecord->Filename, '\\')) | ||
10 | + { | ||
11 | + printf("Filename contains invalid characters\n"); | ||
12 | + exit(1); | ||
13 | + } | ||
14 | + | ||
15 | // Copy file parameters in the search_rec | ||
16 | SearchRecord->Attributes = Entry->FileAttributes; | ||
17 | SearchRecord->FileSize = ENDIAN_SAFE32(Entry->FileSize); |