diff options
| author | Stefan Boberg <[email protected]> | 2022-06-16 15:42:17 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2022-06-16 15:42:17 +0200 |
| commit | b8797a647406d31ebfd137a9ae07819ccf332a10 (patch) | |
| tree | b57dcb1443c817577e1c9f8e10a35837e1d85389 /zenserver/frontend/frontend.cpp | |
| parent | asio: added some context to error reporting (diff) | |
| download | zen-b8797a647406d31ebfd137a9ae07819ccf332a10.tar.xz zen-b8797a647406d31ebfd137a9ae07819ccf332a10.zip | |
merged from main
Diffstat (limited to 'zenserver/frontend/frontend.cpp')
| -rw-r--r-- | zenserver/frontend/frontend.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/zenserver/frontend/frontend.cpp b/zenserver/frontend/frontend.cpp index 842587708..e203e0631 100644 --- a/zenserver/frontend/frontend.cpp +++ b/zenserver/frontend/frontend.cpp @@ -26,7 +26,7 @@ FindZipFsInBinary(const IoBuffer& BinBuffer) uintptr_t Cursor = uintptr_t(BinBuffer.GetData()); size_t BinSize = 0; - uint32_t Magic = *(uint32_t*)(BinBuffer.GetData()); + uint32_t Magic = *(uint32_t*)(Cursor); #if ZEN_PLATFORM_LINUX if (Magic == 0x464c457f) { @@ -134,6 +134,12 @@ FindZipFsInBinary(const IoBuffer& BinBuffer) return {}; } + size_t ZipFsSize = BinBuffer.Size() - BinSize; + if (!ZipFsSize) + { + return {}; + } + return IoBuffer(BinBuffer, BinSize); } |