Fix panic caused by using range over slice len #1357

Merged
fyrchik merged 1 commit from elebedeva/frostfs-node:fix/out-of-range-panics into master 2024-09-06 10:36:52 +00:00
Member

Relates to #1345

If slice is altered in for loop, we cannot use range over its length: it may cause panic if slice gets shorter.

Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com

Relates to #1345 If slice is altered in `for` loop, we cannot use range over its length: it may cause panic if slice gets shorter. Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva added the
internal
label 2024-09-06 10:20:46 +00:00
elebedeva added 1 commit 2024-09-06 10:20:47 +00:00
[#1357] go: Fix panic caused by using range over slice len
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 1m12s
DCO action / DCO (pull_request) Successful in 1m28s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m53s
Tests and linters / Run gofumpt (pull_request) Successful in 1m55s
Build / Build Components (pull_request) Successful in 2m14s
Tests and linters / gopls check (pull_request) Successful in 2m22s
Tests and linters / Staticcheck (pull_request) Successful in 2m30s
Tests and linters / Lint (pull_request) Successful in 3m15s
Tests and linters / Tests (pull_request) Successful in 3m25s
Tests and linters / Tests with -race (pull_request) Successful in 3m31s
f652518c24
If slice is altered in `for` loop, we cannot use range over its
length: it may cause panic if slice gets shorter.

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva requested review from storage-core-committers 2024-09-06 10:21:02 +00:00
elebedeva requested review from storage-core-developers 2024-09-06 10:21:07 +00:00
dstepanov-yadro approved these changes 2024-09-06 10:29:49 +00:00
fyrchik approved these changes 2024-09-06 10:36:46 +00:00
fyrchik merged commit f652518c24 into master 2024-09-06 10:36:52 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1357
No description provided.