diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-28 01:31:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-28 01:31:24 +0300 |
commit | 4b18114e31ea277f9961ea279579da4157ecc2d7 (patch) | |
tree | 575aba1797755004c60d08c382886fb000dd0d2a /src/fs/zip.cpp | |
parent | 6ebd6c0f16cf15bb455b81ca571ef88bac381655 (diff) | |
download | mv-4b18114e31ea277f9961ea279579da4157ecc2d7.tar.gz mv-4b18114e31ea277f9961ea279579da4157ecc2d7.tar.bz2 mv-4b18114e31ea277f9961ea279579da4157ecc2d7.tar.xz mv-4b18114e31ea277f9961ea279579da4157ecc2d7.zip |
Add path sanitization in virtfszip and zip.
Diffstat (limited to 'src/fs/zip.cpp')
-rw-r--r-- | src/fs/zip.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fs/zip.cpp b/src/fs/zip.cpp index 62b60a451..1bdc22639 100644 --- a/src/fs/zip.cpp +++ b/src/fs/zip.cpp @@ -20,6 +20,7 @@ #include "fs/zip.h" +#include "fs/paths.h" #include "fs/virtzipentry.h" #include "fs/ziplocalheader.h" @@ -123,6 +124,7 @@ namespace Zip buf[fileNameLen] = 0; header->fileName = std::string( reinterpret_cast<char*>(buf)); + prepareFsPath(header->fileName); header->dataOffset = ftell(arcFile) + extraFieldLen; fseek(arcFile, extraFieldLen + header->compressSize, SEEK_CUR); // pointer on 30 + fileNameLen + extraFieldLen + compressSize |