stack-buffer-overflow in zip filesystem
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Critical
|
Unassigned |
Bug Description
To reproduce:
1. Drop the attached savefile into the save directory
2. Single Player -> Load Game
The bug is triggered by gl.preload_
=======
==26734==ERROR: AddressSanitizer: stack-buffer-
READ of size 257 at 0x7ffcba31ea20 thread T0
#0 0x7fd0de8ad20a in __interceptor_
#1 0x7fd0dc85ac36 in std::__
#2 0x186f7f8 in ZipFilesystem:
#3 0x18715dc in ZipFilesystem:
#4 0x187483a in FileRead:
#5 0x184eedc in Profile::read(char const*, char const*, FileSystem&) /home/bratzbert
#6 0x16abadf in Widelands:
#7 0x16a448f in Widelands:
#8 0x1544fd5 in LoadOrSaveGame:
#9 0x15422d7 in LoadOrSaveGame:
#10 0x131c4d0 in FullscreenMenuL
#11 0xda62ff in WLApplication:
#12 0xda4bb0 in WLApplication:
#13 0xda4162 in WLApplication:
#14 0xd9eaa2 in WLApplication:
#15 0xd9bb00 in main /home/bratzbert
#16 0x7fd0dbe7082f in __libc_start_main (/lib/x86_
#17 0xd9b9c8 in _start (/home/
Address 0x7ffcba31ea20 is located in stack of thread T0 at offset 672 in frame
#0 0x186f4f7 in ZipFilesystem:
This frame has 5 object(s):
[32, 168) 'file_info'
[224, 256) 'path_in'
[288, 320) 'complete_filename'
[352, 384) '<unknown>'
[416, 672) 'filename_inzip' <== Memory access at offset 672 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
(longjmp and C++ exceptions *are* supported)
Related branches
- Widelands Developers: Pending requested
-
Diff: 28 lines (+7/-2)1 file modifiedsrc/io/filesystem/zip_filesystem.cc (+7/-2)
Changed in widelands: | |
status: | In Progress → Fix Committed |
assignee: | GunChleoc (gunchleoc) → nobody |
While i can unzip other save games, the attached save game couldn't be unzipped, because its broken. When using unzip in terminal:
unzip -l break_zip.wgf
Archive: break_zip.wgf
error [break_zip.wgf]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
How was this save game created?