[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 13/19] contrib/elf2dmp: Use lduw_le_p() to read PDB
From: |
Akihiko Odaki |
Subject: |
[PATCH v3 13/19] contrib/elf2dmp: Use lduw_le_p() to read PDB |
Date: |
Wed, 06 Mar 2024 15:12:19 +0900 |
The relevant value may be unaligned and is little-endian.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
contrib/elf2dmp/pdb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/elf2dmp/pdb.c b/contrib/elf2dmp/pdb.c
index 1c5051425185..492aca4434c8 100644
--- a/contrib/elf2dmp/pdb.c
+++ b/contrib/elf2dmp/pdb.c
@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/bswap.h"
#include "pdb.h"
#include "err.h"
@@ -186,7 +187,7 @@ static bool pdb_init_symbols(struct pdb_reader *r)
r->symbols = symbols;
- r->segments = *(uint16_t *)((const char *)symbols + sizeof(PDB_SYMBOLS) +
+ r->segments = lduw_le_p((const char *)symbols + sizeof(PDB_SYMBOLS) +
symbols->module_size + symbols->offset_size +
symbols->hash_size + symbols->srcmodule_size +
symbols->pdbimport_size + symbols->unknown2_size +
--
2.44.0
- [PATCH v3 07/19] contrib/elf2dmp: Fix error reporting style in pdb.c, (continued)
- [PATCH v3 07/19] contrib/elf2dmp: Fix error reporting style in pdb.c, Akihiko Odaki, 2024/03/06
- [PATCH v3 08/19] contrib/elf2dmp: Fix error reporting style in qemu_elf.c, Akihiko Odaki, 2024/03/06
- [PATCH v3 04/19] contrib/elf2dmp: Change pa_space_create() signature, Akihiko Odaki, 2024/03/06
- [PATCH v3 05/19] contrib/elf2dmp: Fix error reporting style in addrspace.c, Akihiko Odaki, 2024/03/06
- [PATCH v3 10/19] contrib/elf2dmp: Always check for PA resolution failure, Akihiko Odaki, 2024/03/06
- [PATCH v3 02/19] contrib/elf2dmp: Assume error by default, Akihiko Odaki, 2024/03/06
- [PATCH v3 09/19] contrib/elf2dmp: Fix error reporting style in main.c, Akihiko Odaki, 2024/03/06
- [PATCH v3 12/19] contrib/elf2dmp: Ensure segment fits in file, Akihiko Odaki, 2024/03/06
- [PATCH v3 14/19] contrib/elf2dmp: Use rol64() to decode, Akihiko Odaki, 2024/03/06
- [PATCH v3 11/19] contrib/elf2dmp: Always destroy PA space, Akihiko Odaki, 2024/03/06
- [PATCH v3 13/19] contrib/elf2dmp: Use lduw_le_p() to read PDB,
Akihiko Odaki <=
- [PATCH v3 15/19] MAINTAINERS: Add Akihiko Odaki as a elf2dmp reviewer, Akihiko Odaki, 2024/03/06
- [PATCH v3 16/19] contrib/elf2dmp: Build only for little endian host, Akihiko Odaki, 2024/03/06
- [PATCH v3 19/19] contrib/elf2dmp: Ensure phdrs fit in file, Akihiko Odaki, 2024/03/06
- [PATCH v3 17/19] contrib/elf2dmp: Use GPtrArray, Akihiko Odaki, 2024/03/06
- [PATCH v3 18/19] contrib/elf2dmp: Clamp QEMU note to file size, Akihiko Odaki, 2024/03/06