diff options
author | Lei Zhang <thestig@chromium.org> | 2017-05-16 10:48:51 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-16 18:28:31 +0000 |
commit | d3a3cc24a034654b0825e4822446ddfc6a22c045 (patch) | |
tree | 49041ae111c6d611664d6b22946a9e34129d0c83 /xfa/fxfa/parser/cxfa_object.cpp | |
parent | 9774984f96946eb96eed29abfcbe824cb5858bbb (diff) | |
download | pdfium-d3a3cc24a034654b0825e4822446ddfc6a22c045.tar.xz |
Handle when XFA parser error handlers cannot format error messages.
Limit the length of error messages to avoid string formatting failure.
Simplify some CXFA_FMParse error handling code too.
BUG=chromium:708428
Change-Id: I2f5fdb61349a90b3ba681dcc04a26ce0d7f2bdda
Reviewed-on: https://pdfium-review.googlesource.com/5331
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_object.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_object.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp index 30aae88307..bd7daec83a 100644 --- a/xfa/fxfa/parser/cxfa_object.cpp +++ b/xfa/fxfa/parser/cxfa_object.cpp @@ -45,7 +45,7 @@ void CXFA_Object::ThrowIndexOutOfBoundsException() const { void CXFA_Object::ThrowParamCountMismatchException( const CFX_WideString& method) const { - ThrowException(L"Incorrect number of parameters calling method '%s'.", + ThrowException(L"Incorrect number of parameters calling method '%.16s'.", method.c_str()); } @@ -59,6 +59,7 @@ void CXFA_Object::ThrowException(const wchar_t* str, ...) const { va_start(arg_ptr, str); wsMessage.FormatV(str, arg_ptr); va_end(arg_ptr); + ASSERT(!wsMessage.IsEmpty()); FXJSE_ThrowMessage(wsMessage.UTF8Encode().AsStringC()); } |