fix PDF date parsing issue causing crash
The issue is due to optional time zone offset 'mm' field followed by apostrophe being absent, but the parser expecting an extra apostrophe after the time zone 'HH' field apostrophe anyway, causing it go past the end of the date string. Fix the issue by only checking for apostrophe if 'mm' field is present.
This commit is contained in:
parent
1a01da8abb
commit
124e48c6c8
@ -155,11 +155,11 @@ public class Utils {
|
|||||||
throw new ParseException("Invalid UTC offset minutes", position);
|
throw new ParseException("Invalid UTC offset minutes", position);
|
||||||
}
|
}
|
||||||
position += 2;
|
position += 2;
|
||||||
}
|
|
||||||
|
|
||||||
// Apostrophe shall succeed mm
|
// Apostrophe shall succeed mm
|
||||||
if (date.charAt(position) != '\'') {
|
if (date.charAt(position) != '\'') {
|
||||||
throw new ParseException("Expected apostrophe", position);
|
throw new ParseException("Expected apostrophe", position);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user