breakpad/src/common
Mike Frysinger ef04c9c028 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>
2019-08-05 17:38:16 +00:00
..
android Add asm and machine headers 2018-01-03 21:22:16 +00:00
dwarf Fixed a typo introduced in revision 16e08520e6 2018-08-14 14:12:51 +00:00
linux guid_creater: include string.h for memcpy 2019-08-04 04:11:55 +00:00
mac Increase timeout of HTTPMultipartUpload from 10s to 60s. 2019-05-13 20:24:15 +00:00
solaris solaris: fix spurious ; 2015-09-11 12:59:53 -04:00
testdata
tests
windows Fix dump_syms clang Windows build. 2019-06-25 00:28:04 +00:00
basictypes.h Use a proper ignore_result() to fix a ftruncate warn_unused_result warning with GCC 4.8. 2013-12-18 19:52:36 +00:00
byte_cursor.h
byte_cursor_unittest.cc
common.gyp string_conversion: fix pointer math 2019-08-05 17:38:16 +00:00
convert_UTF.c Update license on convert_UTF.* to the standard Unicode license. 2015-02-25 21:16:43 +00:00
convert_UTF.h Update license on convert_UTF.* to the standard Unicode license. 2015-02-25 21:16:43 +00:00
dwarf_cfi_to_module.cc Allow compiling the google-breakpad code using a global ::string class instead of std::string. 2016-11-08 01:29:06 +00:00
dwarf_cfi_to_module.h Allow compiling the google-breakpad code using a global ::string class instead of std::string. 2016-11-08 01:29:06 +00:00
dwarf_cfi_to_module_unittest.cc
dwarf_cu_to_module.cc Skip empty DWARF code range when mapping lines 2018-11-21 15:38:37 +00:00
dwarf_cu_to_module.h Fix debug build after 16e0852 2018-08-18 01:46:46 +00:00
dwarf_cu_to_module_unittest.cc Add support for parsing the DW_AT_ranges attributes 2018-08-13 19:12:00 +00:00
dwarf_line_to_module.cc
dwarf_line_to_module.h
dwarf_line_to_module_unittest.cc
dwarf_range_list_handler.cc Add support for parsing the DW_AT_ranges attributes 2018-08-13 19:12:00 +00:00
dwarf_range_list_handler.h Add support for parsing the DW_AT_ranges attributes 2018-08-13 19:12:00 +00:00
language.cc Use string instead of std::string 2017-03-22 23:22:40 +00:00
language.h Allow compiling the google-breakpad code using a global ::string class instead of std::string. 2016-11-08 01:29:06 +00:00
long_string_dictionary.cc Create LongStringDictionary and replace SimpleStringDictionary on iOS 2017-11-03 17:06:05 +00:00
long_string_dictionary.h Create LongStringDictionary and replace SimpleStringDictionary on iOS 2017-11-03 17:06:05 +00:00
long_string_dictionary_unittest.cc Create LongStringDictionary and replace SimpleStringDictionary on iOS 2017-11-03 17:06:05 +00:00
md5.cc md5: fix strict aliasing warnings 2017-02-07 01:10:12 +00:00
md5.h Fix up ~14 warnings about 'Implicit conversion loses integer precision' on iOS. 2014-02-18 22:52:02 +00:00
memory_allocator.h Rename src/common/memory.h to memory_allocator.h. 2017-10-17 14:02:43 +00:00
memory_allocator_unittest.cc Rename src/common/memory.h to memory_allocator.h. 2017-10-17 14:02:43 +00:00
memory_range.h
memory_range_unittest.cc
minidump_type_helper.h Remove pointers from serialized file format 2014-12-11 01:17:43 +00:00
module.cc Fix debug build after 16e0852 2018-08-18 01:46:46 +00:00
module.h Add support for parsing the DW_AT_ranges attributes 2018-08-13 19:12:00 +00:00
module_unittest.cc Add support for parsing the DW_AT_ranges attributes 2018-08-13 19:12:00 +00:00
path_helper.cc Add missing header for free function 2018-03-27 14:57:55 +00:00
path_helper.h Provide helper wrappers for basename(3) and dirname(3) 2017-10-18 15:44:59 +00:00
scoped_ptr.h Switch scoped_ptr.h to a compatible google3 implementation. 2013-12-18 19:49:55 +00:00
simple_string_dictionary.cc
simple_string_dictionary.h Add index-based set functionality to NonAllocatingMap. 2017-11-07 23:24:48 +00:00
simple_string_dictionary_unittest.cc Add index-based set functionality to NonAllocatingMap. 2017-11-07 23:24:48 +00:00
stabs_reader.cc
stabs_reader.h Fix Mac Breakpad host tools to build in Linux cross-compile 2015-09-16 06:46:55 -04:00
stabs_reader_unittest.cc
stabs_to_module.cc Add support for parsing the DW_AT_ranges attributes 2018-08-13 19:12:00 +00:00
stabs_to_module.h
stabs_to_module_unittest.cc Add support for parsing the DW_AT_ranges attributes 2018-08-13 19:12:00 +00:00
stdio_wrapper.h Rename stdio.h wrapper file to stdio_wrapper.h. 2016-04-05 15:45:30 -04:00
string_conversion.cc string_conversion: fix pointer math 2019-08-05 17:38:16 +00:00
string_conversion.h
string_conversion_unittest.cc string_conversion: fix pointer math 2019-08-05 17:38:16 +00:00
symbol_data.h
test_assembler.cc
test_assembler.h
test_assembler_unittest.cc
unordered.h Use hash_map and hash_set from __gnu_cxx 2018-07-09 19:25:18 +00:00
using_std_string.h