http://git.etersoft.ru/projects
/
wine
/
eterwine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
375d158
)
dbghelp: Properly bail out if get an error while reading ELF header.
author
Eric Pouech
<eric.pouech@orange.fr>
Sat, 20 Mar 2010 08:48:13 +0000
(09:48 +0100)
committer
Alexandre Julliard
<julliard@winehq.org>
Mon, 22 Mar 2010 10:29:14 +0000
(11:29 +0100)
dlls/dbghelp/elf_module.c
patch
|
blob
|
blame
|
history
diff --git
a/dlls/dbghelp/elf_module.c
b/dlls/dbghelp/elf_module.c
index 573a04065c3a7522c8e8b0e38ced62e63a30400c..e0fab9c958c849442a0024630b31b661aa34ff78 100644
(file)
--- a/
dlls/dbghelp/elf_module.c
+++ b/
dlls/dbghelp/elf_module.c
@@
-272,7
+272,12
@@
static BOOL elf_map_file(const WCHAR* filenameW, struct image_file_map* fmap)
lseek(fmap->u.elf.fd, fmap->u.elf.elfhdr.e_shoff, SEEK_SET);
for (i = 0; i < fmap->u.elf.elfhdr.e_shnum; i++)
{
- read(fmap->u.elf.fd, &fmap->u.elf.sect[i].shdr, sizeof(fmap->u.elf.sect[i].shdr));
+ if (read(fmap->u.elf.fd, &fmap->u.elf.sect[i].shdr, sizeof(fmap->u.elf.sect[i].shdr)) != sizeof(fmap->u.elf.sect[i].shdr))
+ {
+ HeapFree(GetProcessHeap, 0, fmap->u.elf.sect);
+ fmap->u.elf.sect = NULL;
+ goto done;
+ }
fmap->u.elf.sect[i].mapped = IMAGE_NO_MAP;
}