[PATCH] debug_str_offsets header version and padding are 2 bytes, not 4 bytes

Mark Wielaard mark@klomp.org
Wed May 15 22:02:08 GMT 2024


Reading too much bytes for the header made debugedit skip the first
actual string offsets table entry.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 tools/debugedit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/debugedit.c b/tools/debugedit.c
index 1a46c13dee47..cbfe70970743 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -2724,10 +2724,10 @@ update_str_offsets (DSO *dso)
       if (unit_length == 0xffffffff || endp - ptr < unit_length)
 	break;
       unsigned char *endidxp = ptr + unit_length;
-      uint32_t version = read_32 (ptr);
+      uint32_t version = read_16 (ptr);
       if (version != 5)
 	break;
-      uint32_t padding = read_32 (ptr);
+      uint32_t padding = read_16 (ptr);
       if (padding != 0)
 	break;
 
-- 
2.39.3



More information about the Debugedit mailing list