Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: xfa/fxfa/parser/xfa_basic_imp.cpp

Issue 2068513002: Add fuzzer for FDE CSS syntax parser. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/libfuzzer/pdf_css_fuzzer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_basic_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_basic_imp.cpp b/xfa/fxfa/parser/xfa_basic_imp.cpp
index 86a96bbd63db6e807ce8ee8c4a32090daa288402..d83d75648c32b76cdc0b493e5d73b6bfabbc2c69 100644
--- a/xfa/fxfa/parser/xfa_basic_imp.cpp
+++ b/xfa/fxfa/parser/xfa_basic_imp.cpp
@@ -557,9 +557,11 @@ int32_t CXFA_WideTextRead::ReadString(FX_WCHAR* pStr,
int32_t iMaxLength,
FX_BOOL& bEOS,
int32_t const* pByteSize) {
- if (iMaxLength > m_wsBuffer.GetLength() - m_iPosition) {
+ if (iMaxLength > m_wsBuffer.GetLength() - m_iPosition)
iMaxLength = m_wsBuffer.GetLength() - m_iPosition;
- }
+ if (iMaxLength == 0)
dsinclair 2016/06/13 20:05:47 This is needed because the corpus was seeding with
Oliver Chang 2016/06/13 20:11:19 It's probably best to do if (size == 0) return
dsinclair 2016/06/13 20:19:22 I think the check is valid here. We can't proceed
+ return 0;
+
FXSYS_wcsncpy(pStr, m_wsBuffer.c_str() + m_iPosition, iMaxLength);
m_iPosition += iMaxLength;
bEOS = IsEOF();
« no previous file with comments | « testing/libfuzzer/pdf_css_fuzzer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698