summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Kulczycki <kacper.kulczycki@avidata.pl>2018-06-22 19:18:25 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2018-06-22 19:18:25 +0200
commitb27f1916792ceed3eedfc2bc9121ddf43a165f6c (patch)
tree2f6c3369faebbd8262e8311c0611d211e640504a
parent7f0de63ce27e7527159402dc0b6633e86d102b73 (diff)
PhotoRec: avoid more bad chars in filenames
-rw-r--r--src/filegen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/filegen.c b/src/filegen.c
index 9568543..f48f21d 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -429,7 +429,7 @@ int file_rename(file_recovery_t *file_recovery, const void *buffer, const int bu
bad++;
break;
default:
- if(isprint(*src) && !isspace(*src))
+ if(isprint(*src) && !isspace(*src) && !ispunct(*src) && !iscntrl(*src))
{
*dst++ = *src;
ok++;
@@ -542,7 +542,7 @@ int file_rename_unicode(file_recovery_t *file_recovery, const void *buffer, cons
bad++;
break;
default:
- if(isprint(*src) && !isspace(*src))
+ if(isprint(*src) && !isspace(*src) && !ispunct(*src) && !iscntrl(*src))
{
*dst++ = *src;
ok++;