[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] contrib/elf2dmp: Use lduw_le_p() to read PDB
From: |
Akihiko Odaki |
Subject: |
[PATCH 4/7] contrib/elf2dmp: Use lduw_le_p() to read PDB |
Date: |
Sun, 03 Mar 2024 19:50:38 +0900 |
This resolved UBSan warnings.
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 40991f5f4c34..2541234205c3 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"
@@ -187,7 +188,7 @@ static int 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 0/7] contrib/elf2dmp: Improve robustness, Akihiko Odaki, 2024/03/03
- [PATCH 1/7] contrib/elf2dmp: Always check for PA resolution failure, Akihiko Odaki, 2024/03/03
- [PATCH 2/7] contrib/elf2dmp: Always destroy PA space, Akihiko Odaki, 2024/03/03
- [PATCH 3/7] contrib/elf2dmp: Ensure segment fits in file, Akihiko Odaki, 2024/03/03
- [PATCH 4/7] contrib/elf2dmp: Use lduw_le_p() to read PDB,
Akihiko Odaki <=
- [PATCH 5/7] contrib/elf2dmp: Use rol64() to decode, Akihiko Odaki, 2024/03/03
- [PATCH 7/7] MAINTAINERS: Add Akihiko Odaki as a elf2dmp reviewer, Akihiko Odaki, 2024/03/03
- [PATCH 6/7] contrib/elf2dmp: Continue even contexts are lacking, Akihiko Odaki, 2024/03/03
- Re: [PATCH 0/7] contrib/elf2dmp: Improve robustness, Peter Maydell, 2024/03/04