Re: [PATCH] fuzz: add new oss-fuzz fuzzer for date.c / date.h
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 12, 2023, 12:39 UTC
- Message-ID
- <xmqq7cmnno1n.fsf@gitster.g>
- In-Reply-To
- <xmqqfs1bo6l4.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> As I used the first byte to fuzz dmtype and .local, let's use the > next three bytes to allow feeding overly wild timezone values to the > machinery and see what breaks, perhaps like so: > > tz = *data++; /* int tz; */ > tz = (tz << 8) | *data++; > tz = (tz << 8) | *data++; > size -= 3;
Just this part. As data points at unsigned char, the above would not give us any negative number. We'd need to sign-extend the 24-bit resulting value if we are going to adopt the above approach.