summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-02-26 17:00:39 +0100
committerMark Wielaard <[email protected]>2014-03-03 09:26:10 +0100
commit8f4402f7cd1a8b82f890a219d97106cbf918cf92 (patch)
treee8b5b4c29fc270f621019628e9d3244535954de6
parent48827ec6cb2169bad15baf7702f86c4bf2847beb (diff)
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 <[email protected]>
-rw-r--r--libdwfl/ChangeLog4
-rw-r--r--libdwfl/linux-proc-maps.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index aacc0bf2..ae586605 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,5 +1,9 @@
2014-02-26 Mark Wielaard <[email protected]>
+ * linux-proc-maps.c (proc_maps_report): Don't assert on bad input.
+
+2014-02-26 Mark Wielaard <[email protected]>
+
* elf-from-memory.c (elf_from_remote_memory): Check against p64
p_type in case ELFCLASS64, not against p32 p_type.
diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c
index cdb6959d..a52920cd 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