Skip to content
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

[v23.2.x] storage/disk_log_impl: defensive reverse iteration of _segs #15602

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #15440
Fixes: #15601,

if _segs is empty (not in the precondition) size() -1 would underflow
and we would access garbage
if _segs has size 1, we would underflow afther the loop check (i-->0)
and access garbage
if _segs is bigger than 1, we would exclude from the count the active
segment

(cherry picked from commit ba0384e)
see issues/15417

(cherry picked from commit fcf433c)
@vbotbuildovich vbotbuildovich added this to the v23.2.x-next milestone Dec 14, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Dec 14, 2023
@andijcr andijcr marked this pull request as ready for review December 14, 2023 15:45
@andijcr
Copy link
Contributor

andijcr commented Dec 15, 2023

/dt

@piyushredpanda piyushredpanda merged commit 58c6fd5 into redpanda-data:v23.2.x Dec 20, 2023
24 checks passed
@piyushredpanda piyushredpanda modified the milestones: v23.2.x-next, v23.2.21 Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants