Skip to content

refactor: fix out of bounds array access in for-loop #5

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
Jun 29, 2024

Conversation

deepsource-autofix[bot]
Copy link
Contributor

When iterating over an array's indices using a for-loop, it is easy to unintentionally perform an out-of-bounds access if the loop's test isn't performed correctly. The condition i <= array.length goes from i to array.length (inclusive), and may therefore introduce an OOB access if the loop has array[i] anywhere inside it.

When iterating over an array's indices using a for-loop, it is easy to unintentionally perform an out-of-bounds access if the loop's test isn't performed correctly. The condition `i <= array.length` goes from `i` to `array.length` (inclusive), and may therefore introduce an OOB access if the loop has `array[i]` anywhere inside it.
Copy link
Contributor

deepsource-io bot commented Jun 29, 2024

Here's the code health analysis summary for commits 10d8f0f..af61444. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
🎯 4 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@infinotiver infinotiver merged commit fd9f9c7 into main Jun 29, 2024
1 of 2 checks passed
@infinotiver infinotiver deleted the deepsource-autofix-019ece25 branch June 29, 2024 15:49
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.

1 participant