summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_sysfontinfo.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-05 15:33:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-06 13:53:19 +0000
commit81f9eeef041f2974274751d7508598049ae32db2 (patch)
tree00bdcdddc9d141e4929005a14372bde65c68ee81 /fpdfsdk/fpdf_sysfontinfo.cpp
parent3ef61c73a97b31000a21e323e04ad5397e517c4c (diff)
downloadpdfium-81f9eeef041f2974274751d7508598049ae32db2.tar.xz
Convert FX_STRSIZE int->size_t
Change the underlying type for FX_STRSIZE to size_t from int. This will make the value unsigned and thus all values in the range of the type will be valid. This allows for the final remove of negative length strings, but also introduces a some casting and functional errors, since many parts of the code base assume that FX_STRSIZE is int or another signed type. This also CL fixes these errors. BUG=pdfium:828 Change-Id: I231dca59e96fc9330cbb099eecbdfc41fcf86f5b Reviewed-on: https://pdfium-review.googlesource.com/11830 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_sysfontinfo.cpp')
-rw-r--r--fpdfsdk/fpdf_sysfontinfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index 9228326096..92c99373cf 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -171,7 +171,7 @@ static unsigned long DefaultGetFaceName(struct _FPDF_SYSFONTINFO* pThis,
auto* pDefault = static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pThis);
if (!pDefault->m_pFontInfo->GetFaceName(hFont, &name))
return 0;
- if (name.GetLength() >= (long)buf_size)
+ if (name.GetLength() >= static_cast<FX_STRSIZE>(buf_size))
return name.GetLength() + 1;
strncpy(buffer, name.c_str(),