commit | bf014cf0006a70dfb959585c7e50ec6f4f7be6c3 | [log] [tgz] |
---|---|---|
author | Tom Sepez <tsepez@chromium.org> | Fri May 19 13:48:25 2017 -0700 |
committer | Chromium commit bot <commit-bot@chromium.org> | Fri May 19 23:05:21 2017 +0000 |
tree | 063e98b1056966bd4519b5dd743a6ad2c8502fd5 | |
parent | 41e3c35db0d01098fcf8cb86e22ff6ac846d5a15 [diff] |
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>
diff --git a/core/fpdfapi/font/fpdf_font_cid.cpp b/core/fpdfapi/font/fpdf_font_cid.cpp index e451546..dd37551 100644 --- a/core/fpdfapi/font/fpdf_font_cid.cpp +++ b/core/fpdfapi/font/fpdf_font_cid.cpp
@@ -687,7 +687,7 @@ 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) {