Croniter get_next fix (#10068)

Fix for an incorrect call to `get_next` that was stopping the Croniter
`fuzz_iter` executing, see
[https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57139#c2](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57139#c2).

It was being called with a `datetime` object instead of a `datetime`
class as it's `ret_type` argument causing a type error. I've removed the
argument that's fixed it.

Also I've added the `undefined` sanitizer as it was missing from the
`project.yaml`. I've done a local run and it works fine with it enabled.
This commit is contained in:
Sean Gilligan 2023-04-12 19:55:49 +01:00 committed by GitHub
parent 05338d3e0d
commit 2aa8de903e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -27,15 +27,15 @@ def TestOneInput(data):
try:
cron_str = fdp.ConsumeString(50)
hash_id = fdp.ConsumeBytes(2)
croniter.croniter.is_valid(cron_str)
croniter.croniter.is_valid(cron_str, hash_id=hash_id)
itr = croniter.croniter(cron_str, base, hash_id=hash_id)
idx = 0
for v in itr.all_next():
idx += 1
if idx > 10:
break
itr.get_next(base)
itr.get_prev(base)
itr.get_next()
itr.get_prev()
except (CroniterError, CroniterBadTypeRangeError) as e:
pass
except NameError as e: