summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-01-30 19:12:10 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 19:12:10 +0000
commitaa1c7873c39964d063c89c14815e3fc566bbd896 (patch)
tree257726f71b9318d51587a9ed0d414e7acbdb0b46 /fpdfsdk
parent8cdea72a82aae5e07aa92e9886dbbe635eb8b7cc (diff)
downloadpdfium-aa1c7873c39964d063c89c14815e3fc566bbd896.tar.xz
Guard usages of tellp(). It may return -1 in error cases.
Change-Id: I064ddcad8671b9ade2c02142a6c2c2983846e3a9 Reviewed-on: https://pdfium-review.googlesource.com/24650 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 03a782b15b..3b76dca682 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -530,7 +530,7 @@ bool CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, size_t& nBufSize) {
}
nBufSize = fdfEncodedData.tellp();
- if (nBufSize == 0)
+ if (nBufSize <= 0)
return false;
pBuf = FX_Alloc(uint8_t, nBufSize);