summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-19 13:48:25 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-19 23:05:21 +0000
commitbf014cf0006a70dfb959585c7e50ec6f4f7be6c3 (patch)
tree063e98b1056966bd4519b5dd743a6ad2c8502fd5
parent41e3c35db0d01098fcf8cb86e22ff6ac846d5a15 (diff)
downloadpdfium-bf014cf0006a70dfb959585c7e50ec6f4f7be6c3.tar.xz
Fix off-by-one introduced at ab20404
Building a little-endian n-byte value via a single byte store and a memset(0) is dubious, but don't clobber the value we just stored. Bug: 723625 Change-Id: I015ea3e01c63a534f2ca0a1c085ed67777330d82 Reviewed-on: https://pdfium-review.googlesource.com/5732 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
-rw-r--r--core/fpdfapi/font/fpdf_font_cid.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fpdfapi/font/fpdf_font_cid.cpp b/core/fpdfapi/font/fpdf_font_cid.cpp
index e45154600b..dd37551b2d 100644
--- a/core/fpdfapi/font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/font/fpdf_font_cid.cpp
@@ -687,7 +687,7 @@ int CPDF_CMap::AppendChar(char* str, uint32_t charcode) const {
iSize = 1;
str[iSize - 1] = (uint8_t)charcode;
if (iSize > 1)
- memset(str + 1, 0, iSize - 1);
+ memset(str, 0, iSize - 1);
return iSize;
}
if (charcode < 0x10000) {