mirror of
https://git.code.sf.net/p/fldigi/flmsg
synced 2026-08-13 17:30:58 -04:00
Corrupt filenames
* Added code to subvert malign filenames contained in
the wrapped file
This commit is contained in:
parent
f2c88a0812
commit
f4a3c8c79a
1 changed files with 10 additions and 0 deletions
|
|
@ -380,6 +380,16 @@ bool unwrapfile()
|
|||
wrap_outshortname = wtext.substr(0, p);
|
||||
wrap_outshortname.erase(0, strlen(wrap_fn));
|
||||
wtext.erase(0,p+1);
|
||||
// check for protocol abuse
|
||||
if (wrap_outshortname.find('/') != string::npos || // linux path indicator
|
||||
wrap_outshortname.find('\\') != string::npos || // windows path indicator
|
||||
wrap_outshortname == "." || // current pwd path indicator
|
||||
wrap_outshortname == ".." || // parent pwd path indicator
|
||||
wrap_outshortname.find(":") || // windows drive indicator
|
||||
wrap_outshortname.empty() ) { // null filename
|
||||
errtext = "Filename corrupt, possible protocol abuse";
|
||||
return false;
|
||||
}
|
||||
wrap_outfilename = wrap_foldername;
|
||||
wrap_outfilename.append(wrap_outshortname);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue