[PATCH 2/3] Fix debug link crc reading
- From: Pauli Nieminen <suokkos gmail com>
- To: sysprof-list gnome org
- Cc: Søren Sandmann Pedersen <sandmann daimi au dk>, Pauli Nieminen <suokkos gmail com>
- Subject: [PATCH 2/3] Fix debug link crc reading
- Date: Mon, 9 Apr 2012 21:13:00 +0300
Debug link crc values is strored after null terminated string in 4
aligned offset. But sysprof was only taking into accoutn alignment
that made elf parser read wrong crc from the debug link string.
Fix is simple check for string length and adding the length to offset
before alignment.
Signed-off-by: Pauli Nieminen <suokkos gmail com>
---
elfparser.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/elfparser.c b/elfparser.c
index 09f08f5..d10fce7 100644
--- a/elfparser.c
+++ b/elfparser.c
@@ -744,7 +744,8 @@ elf_parser_get_debug_link (ElfParser *parser, guint32 *crc32)
if (crc32)
{
- offset = (offset + 3) & ~0x3;
+ int len = strlen (result) + 1;
+ offset = (offset + len + 3) & ~0x3;
*crc32 = GET_UINT32 (parser, offset);
}
--
1.7.5.4
[Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]