diff options
| author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-14 00:00:00 +0000 |
|---|---|---|
| committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-05-15 23:55:04 +0500 |
| commit | fc662341e6f85da78ada0e443f6116b978f79f22 (patch) | |
| tree | 1be1cc402a7a9cbc18d4eeea6b141354c2d559e3 /CPP/Windows/FileLink.cpp | |
| parent | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (diff) | |
| download | 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.gz 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.tar.bz2 7zip-fc662341e6f85da78ada0e443f6116b978f79f22.zip | |
24.0524.05
Diffstat (limited to 'CPP/Windows/FileLink.cpp')
| -rw-r--r-- | CPP/Windows/FileLink.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/CPP/Windows/FileLink.cpp b/CPP/Windows/FileLink.cpp index 2b9fa1a..bb380ec 100644 --- a/CPP/Windows/FileLink.cpp +++ b/CPP/Windows/FileLink.cpp | |||
| @@ -249,9 +249,13 @@ bool CReparseAttr::Parse(const Byte *p, size_t size) | |||
| 249 | if (size < 8) | 249 | if (size < 8) |
| 250 | return false; | 250 | return false; |
| 251 | Tag = Get32(p); | 251 | Tag = Get32(p); |
| 252 | UInt32 len = Get16(p + 4); | 252 | if (Get16(p + 6) != 0) // padding |
| 253 | if (len + 8 != size) | 253 | return false; |
| 254 | // if (len + 8 > size) | 254 | unsigned len = Get16(p + 4); |
| 255 | p += 8; | ||
| 256 | size -= 8; | ||
| 257 | if (len != size) | ||
| 258 | // if (len > size) | ||
| 255 | return false; | 259 | return false; |
| 256 | /* | 260 | /* |
| 257 | if ((type & kReparseFlags_Alias) == 0 || | 261 | if ((type & kReparseFlags_Alias) == 0 || |
| @@ -259,8 +263,6 @@ bool CReparseAttr::Parse(const Byte *p, size_t size) | |||
| 259 | (type & 0xFFFF) != 3) | 263 | (type & 0xFFFF) != 3) |
| 260 | */ | 264 | */ |
| 261 | 265 | ||
| 262 | if (Get16(p + 6) != 0) // padding | ||
| 263 | return false; | ||
| 264 | 266 | ||
| 265 | HeaderError = false; | 267 | HeaderError = false; |
| 266 | 268 | ||
| @@ -276,9 +278,6 @@ bool CReparseAttr::Parse(const Byte *p, size_t size) | |||
| 276 | 278 | ||
| 277 | TagIsUnknown = false; | 279 | TagIsUnknown = false; |
| 278 | 280 | ||
| 279 | p += 8; | ||
| 280 | size -= 8; | ||
| 281 | |||
| 282 | if (Tag == Z7_WIN_IO_REPARSE_TAG_LX_SYMLINK) | 281 | if (Tag == Z7_WIN_IO_REPARSE_TAG_LX_SYMLINK) |
| 283 | { | 282 | { |
| 284 | if (len < 4) | 283 | if (len < 4) |
| @@ -518,7 +517,7 @@ bool SetReparseData(CFSTR path, bool isDir, const void *data, DWORD size) | |||
| 518 | { | 517 | { |
| 519 | CreatePrefixDirOfFile(path); | 518 | CreatePrefixDirOfFile(path); |
| 520 | COutFile file; | 519 | COutFile file; |
| 521 | if (!file.Create(path, CREATE_NEW)) | 520 | if (!file.Create_NEW(path)) |
| 522 | return false; | 521 | return false; |
| 523 | } | 522 | } |
| 524 | } | 523 | } |
