Fix bounds checking in CJS_PublicMethods::MakeRegularDate().
authorTom Sepez <tsepez@chromium.org>
Fri, 18 Jul 2014 21:42:12 +0000 (14:42 -0700)
committerTom Sepez <tsepez@chromium.org>
Fri, 18 Jul 2014 21:42:12 +0000 (14:42 -0700)
commit5ffacd677a141ed2756009b0f4a07ee4cf284a1b
treeb6479ce43fb8cae19f7a5a44cb8a7454f1219408
parent6256a14279e46f1e893a32bf5102d698fe111cfa
Fix bounds checking in CJS_PublicMethods::MakeRegularDate().

The function is looking ahead N characters at both its "format" and "value"
strings without validating that accesses are in bounds.  Add those validations.

There are also duplicate checks in the else-branches which re-test the inverse
of the if-branch.  These are removed for simplicity.

I also tidied some stray whitespace in the function while I was at it.

BUG=393831
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/395303004
AUTHORS
fpdfsdk/src/javascript/PublicMethods.cpp