diff --git a/src/format.c b/src/format.c index 9a713fcf..8210d260 100644 --- a/src/format.c +++ b/src/format.c @@ -206,7 +206,7 @@ static void ToValidLabel(WCHAR* name, BOOL bFAT) { size_t i, j, k; BOOL found; - WCHAR unauthorized[] = L"*?,;:/\\|+=<>[]"; + WCHAR unauthorized[] = L"*?,;:/\\|+=<>[]\""; WCHAR to_underscore[] = L"\t."; if (name == NULL) diff --git a/src/iso.c b/src/iso.c index 33364e11..cfc482ab 100644 --- a/src/iso.c +++ b/src/iso.c @@ -91,6 +91,25 @@ static __inline char* size_to_hr(int64_t size) return str_size; } +// Ensure filenames do not contain invalid FAT32 or NTFS characters +static __inline BOOL sanitize_filename(char* filename) +{ + size_t i, j; + BOOL ret = FALSE; + char unauthorized[] = {'<', '>', ':', '|', '*', '?'}; + + // Must start after the drive part (D:\...) so that we don't eliminate the first column + for (i=2; i