aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2019-08-03 11:28:50 -0400
committerMike Frysinger <vapier@chromium.org>2019-08-05 17:38:16 +0000
commitef04c9c028132b3e3dcd7ff43c2ddd0c24ad668b (patch)
tree5d305858efe9a543a0ec1c1dacc47ad8d99b0e64 /Makefile.am
parentguid_creater: include string.h for memcpy (diff)
downloadbreakpad-ef04c9c028132b3e3dcd7ff43c2ddd0c24ad668b.tar.xz
string_conversion: fix pointer math
Since target_ptr is of type uint16_t* already, we don't need to scale the byte count as the language does that for us. If it were void*, we would need this code, but it's not. In practice it's probably not a big deal due to how we preallocated memory: when converting UTF8->UTF16, we'd reserve the same number of code units, and UTF8 takes more code units per codepoint than UTF16, so the UTF16 vector is always oversized. When converting UTF32->UTF16, we also reserve the same number of code units, but since one UTF32 code unit could require two UTF16 code units (for U+10000 codepoints and higher), we would probably corrupt memory in the process. The APIs in this module don't seem to take into account that range in general, so for now I'm only fixing the memory corruption. Bug: google-breakpad:768 Change-Id: Ibfaea4e866733ff8d99b505e72c500bd40d11a74 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1732888 Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 8d806473..c8a57406 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -658,6 +658,7 @@ src_tools_mac_dump_syms_dump_syms_mac_LDADD= \
src_common_dumper_unittest_SOURCES = \
src/common/byte_cursor_unittest.cc \
+ src/common/convert_UTF.c \
src/common/dwarf_cfi_to_module.cc \
src/common/dwarf_cfi_to_module_unittest.cc \
src/common/dwarf_cu_to_module.cc \
@@ -674,6 +675,8 @@ src_common_dumper_unittest_SOURCES = \
src/common/stabs_reader_unittest.cc \
src/common/stabs_to_module.cc \
src/common/stabs_to_module_unittest.cc \
+ src/common/string_conversion.cc \
+ src/common/string_conversion_unittest.cc \
src/common/test_assembler.cc \
src/common/dwarf/bytereader.cc \
src/common/dwarf/bytereader.h \