Fix crash in libdw with empty input files.
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index aafa1c9..ba946c2 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-10 Ulrich Drepper <drepper@redhat.com>
+
+ * open.c (decompress): Avoid crash with empty input file.
+
2009-01-27 Roland McGrath <roland@redhat.com>
* dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
diff --git a/libdwfl/open.c b/libdwfl/open.c
index 611295f..0ab2a9d 100644
--- a/libdwfl/open.c
+++ b/libdwfl/open.c
@@ -75,6 +75,8 @@
void *const mapped = ((*elf)->map_address == NULL ? NULL
: (*elf)->map_address + (*elf)->start_offset);
const size_t mapped_size = (*elf)->maximum_size;
+ if (mapped_size == 0)
+ return error;
error = __libdw_gunzip (fd, offset, mapped, mapped_size, &buffer, &size);
if (error == DWFL_E_BADELF)