diff options
author | Mike Frysinger <vapier@chromium.org> | 2019-08-03 11:28:50 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2019-08-05 17:38:16 +0000 |
commit | ef04c9c028132b3e3dcd7ff43c2ddd0c24ad668b (patch) | |
tree | 5d305858efe9a543a0ec1c1dacc47ad8d99b0e64 /src/tools | |
parent | guid_creater: include string.h for memcpy (diff) | |
download | breakpad-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 'src/tools')
0 files changed, 0 insertions, 0 deletions