| #include "git-compat-util.h" |
| int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); |
| int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
| enum date_mode_type dmtype; |
| * we use the first byte to fuzz dmtype and the |
| * second byte to fuzz local, then the next two |
| * bytes to fuzz tz offset. The remainder |
| * (at least one byte) is fed as input to |
| local = !!(*data++ & 0x10); |
| num = *data++ % DATE_UNIX; |
| if (num >= DATE_STRFTIME) |
| dmtype = (enum date_mode_type)num; |
| tz = (tz << 8) | *data++; |
| str = xmemdupz(data, size); |
| ts = approxidate_careful(str, &num); |
| dm = date_mode_from_type(dmtype); |
| show_date(ts, (int)tz, dm); |