summaryrefslogtreecommitdiff
path: root/fxbarcode
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-30 17:04:58 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-02 19:11:28 +0000
commit48fbb0f8de36d224eea498ad45f641bb5613e3f0 (patch)
treefa336e1fc9300127aa90d2445d47d6b7929dcd1d /fxbarcode
parentd9e0e6e46d1f24231b8ab3def4cc197554e96fe7 (diff)
downloadpdfium-48fbb0f8de36d224eea498ad45f641bb5613e3f0.tar.xz
Pass explicit string size in EncodeToCodewords().
The input wchar_t array is not NUL-terminated. BUG=chromium:716706 Change-Id: I0a89324fa46a56a39cc3331fcdd1c26b1550828b Reviewed-on: https://pdfium-review.googlesource.com/4631 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxbarcode')
-rw-r--r--fxbarcode/datamatrix/BC_C40Encoder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fxbarcode/datamatrix/BC_C40Encoder.cpp b/fxbarcode/datamatrix/BC_C40Encoder.cpp
index 8d352b1a98..a264482305 100644
--- a/fxbarcode/datamatrix/BC_C40Encoder.cpp
+++ b/fxbarcode/datamatrix/BC_C40Encoder.cpp
@@ -40,7 +40,7 @@ CFX_WideString EncodeToCodewords(const CFX_WideString& sb, int32_t startPos) {
wchar_t cw[2];
cw[0] = static_cast<wchar_t>(v / 256);
cw[1] = static_cast<wchar_t>(v % 256);
- return CFX_WideString(cw);
+ return CFX_WideString(cw, FX_ArraySize(cw));
}
} // namespace