From bf014cf0006a70dfb959585c7e50ec6f4f7be6c3 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 19 May 2017 13:48:25 -0700 Subject: 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 Commit-Queue: Tom Sepez --- core/fpdfapi/font/fpdf_font_cid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') 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) { -- cgit v1.2.3