mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Sanitise bad characters in log file names.
On Windows, colons are illegal in filenames, because they're part of the path syntax. But colons can appear in automatically constructed log file names, if an IPv6 address is expanded from the &H placeholder. Now we coerce any such illegal characters to '.', which is a bit of a bodge but should at least cause a log file to be generated.
This commit is contained in:
@ -71,6 +71,13 @@ Filename *filename_deserialise(void *vdata, int maxsize, int *used)
|
||||
return filename_from_str(data);
|
||||
}
|
||||
|
||||
char filename_char_sanitise(char c)
|
||||
{
|
||||
if (strchr("<>:\"/\\|?*", c))
|
||||
return '.';
|
||||
return c;
|
||||
}
|
||||
|
||||
#ifndef NO_SECUREZEROMEMORY
|
||||
/*
|
||||
* Windows implementation of smemclr (see misc.c) using SecureZeroMemory.
|
||||
|
Reference in New Issue
Block a user