From: Mark Wielaard Date: Wed, 26 Feb 2014 16:00:39 +0000 (+0100) Subject: libdwfl: linux-proc-maps.c (proc_maps_report): Don't assert on bad input. X-Git-Tag: elfutils-0.159~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f4402f7cd1a8b82f890a219d97106cbf918cf92;p=thirdparty%2Felfutils.git libdwfl: linux-proc-maps.c (proc_maps_report): Don't assert on bad input. If ino == last_ino && dmajor == last_dmajor && dminor == last_dminor then we expect the file names to be the same as well. Which is reasonable if the input came from the /proc file system. But there could be bad user input if the file was supplied through dwfl_linux_proc_maps_report. Instead of asserting on the bad input, just signal a bad_report. Signed-off-by: Mark Wielaard --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index aacc0bf2a..ae5866051 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2014-02-26 Mark Wielaard + + * linux-proc-maps.c (proc_maps_report): Don't assert on bad input. + 2014-02-26 Mark Wielaard * elf-from-memory.c (elf_from_remote_memory): Check against p64 diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c index cdb6959db..a52920cda 100644 --- a/libdwfl/linux-proc-maps.c +++ b/libdwfl/linux-proc-maps.c @@ -241,7 +241,8 @@ proc_maps_report (Dwfl *dwfl, FILE *f, GElf_Addr sysinfo_ehdr, pid_t pid) && ino == last_ino && dmajor == last_dmajor && dminor == last_dminor) { /* This is another portion of the same file's mapping. */ - assert (!strcmp (last_file, file)); + if (strcmp (last_file, file) != 0) + goto bad_report; high = end; } else