diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-06-21 23:36:59 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-06-21 23:40:24 +0200 |
commit | a35d4ce9ccb3eb5903df3d221fdfd9a0d1fb5c37 (patch) | |
tree | e6557a1cb3b776f72f8b6d969786549763a86df4 /libqpdf/QUtil.cc | |
parent | 2320714339b572a4d5bceadfcfc94356aa782ada (diff) | |
download | qpdf-a35d4ce9ccb3eb5903df3d221fdfd9a0d1fb5c37.tar.zst |
Fix bounds error in utf16_to_utf8 conversion
Diffstat (limited to 'libqpdf/QUtil.cc')
-rw-r--r-- | libqpdf/QUtil.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index c8c23f6a..607c28f7 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -1955,7 +1955,7 @@ QUtil::utf16_to_utf8(std::string const& val) } // If the string has an odd number of bytes, the last byte is // ignored. - for (size_t i = start; i < len; i += 2) + for (size_t i = start; i + 1 < len; i += 2) { // Convert from UTF16-BE. If we get a malformed // codepoint, this code will generate incorrect output |