tustvold commented on code in PR #5078:
URL: https://github.com/apache/arrow-rs/pull/5078#discussion_r1405471882
##########
arrow-cast/src/parse.rs:
##########
@@ -559,8 +559,30 @@ fn parse_date(string: &str) -> Option<NaiveDate> {
const HYPHEN: u8 = b'-'.wrapping_sub(b'0');
+ // refer to https://www.rfc-editor.org/rfc/rfc3339#section-3
if digits[4] != HYPHEN {
- return None;
+ if string.len() != 8 {
+ return None;
+ }
+
+ for ch in string.bytes() {
+ if !ch.is_ascii_digit() {
+ return None;
+ }
+ }
+
Review Comment:
```suggestion
```
The mask already validates this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]