Skip to content

fix: week error in fuzzing scripts #4897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged

Conversation

its403
Copy link
Contributor

@its403 its403 commented Mar 4, 2025

Issue:
In bash, when you use (( for arithmetic evaluation, numbers with leading zeros are interpreted as octal numbers. Since '9' isn't a valid octal digit, you get the error: value too great for base (error token is "09").

Fix:
This PR updates the script to force decimal interpretation of the week number using 10# in the arithmetic expression:
at_index=$(((10#$(date -u +%U)) % ${#fuzzing_scripts[@]}))

Screenshot 2025-03-04 174632

As you can see now, the correct script is being selected for week 9. I've also tested running fuzzing script on my fork in GitHub Actions.

https://github.com/its403/cve-bin-tool/actions/runs/13652954835/job/38165491473

Copy link
Member

@mastersans mastersans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. It seems i need to take some bash lessons, but hey this one was some of my first contributions.

@terriko
Copy link
Contributor

terriko commented Mar 4, 2025

Thank you! I'll get this merged and then I'll re-run the fuzzer for this week.

@terriko terriko merged commit 7ef9844 into intel:main Mar 4, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants