summaryrefslogtreecommitdiff
path: root/src/binary-reader-objdump.h
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-08-19 11:28:42 -0700
committerGitHub <noreply@github.com>2020-08-19 11:28:42 -0700
commit713becedfe45e7b7a993d7efb6fd2994f064b234 (patch)
tree2fce05c3ec6b9e7532f080e8ea75db64661999b6 /src/binary-reader-objdump.h
parent40f6a8a9354f335f9bbe05b1962172873c2913f0 (diff)
downloadwabt-713becedfe45e7b7a993d7efb6fd2994f064b234.tar.gz
wabt-713becedfe45e7b7a993d7efb6fd2994f064b234.tar.bz2
wabt-713becedfe45e7b7a993d7efb6fd2994f064b234.zip
Fix integer overflow in objdump name tracking (#1524)
Fixes: #1520
Diffstat (limited to 'src/binary-reader-objdump.h')
-rw-r--r--src/binary-reader-objdump.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/binary-reader-objdump.h b/src/binary-reader-objdump.h
index 8c609474..b1e24f81 100644
--- a/src/binary-reader-objdump.h
+++ b/src/binary-reader-objdump.h
@@ -17,8 +17,8 @@
#ifndef WABT_BINARY_READER_OBJDUMP_H_
#define WABT_BINARY_READER_OBJDUMP_H_
+#include <map>
#include <string>
-#include <vector>
#include "src/common.h"
#include "src/feature.h"
@@ -59,9 +59,8 @@ struct ObjdumpSymbol {
struct ObjdumpNames {
string_view Get(Index index) const;
void Set(Index index, string_view name);
- void push_back(string_view name);
- std::vector<std::string> names;
+ std::map<Index, std::string> names;
};
// read_binary_objdump uses this state to store information from previous runs