Fix search for colon in IsIsoTimeFormat() Look for colon separator relative to index, not at fixed offset 2. This has been wrong since at least 2018. Unfortunately, testing is thin because IsoTime2Num test is disabled. Change-Id: I7c06f900a9892ca9be10bcf3b674be33c8ee3d0e Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/109030 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cfxjse_formcalc_context.cpp b/fxjs/xfa/cfxjse_formcalc_context.cpp index 790ec94..695cc25 100644 --- a/fxjs/xfa/cfxjse_formcalc_context.cpp +++ b/fxjs/xfa/cfxjse_formcalc_context.cpp
@@ -630,7 +630,7 @@ if (FXSYS_atoi(szBuffer) > 60) { return false; } - if (pData[2] == ':') { + if (iIndex + 2 < iZone && pData[iIndex + 2] == ':') { if (iPos == 0) { iHour = FXSYS_atoi(szBuffer); ++iPos; @@ -701,7 +701,7 @@ if (FXSYS_atoi(szBuffer) > 60) { return false; } - if (pData[2] == ':') { + if (iIndex + 2 < pData.size() && pData[iIndex + 2] == ':') { if (iPos == 0) { iZoneHour = FXSYS_atoi(szBuffer); } else if (iPos == 1) {