Skip to content

fix DIVISION_BY_ZERO.EX in pb#230

Merged
cheggaaa merged 1 commit into
cheggaaa:masterfrom
petrvaganoff:svace-ICS-51660
Jun 9, 2026
Merged

fix DIVISION_BY_ZERO.EX in pb#230
cheggaaa merged 1 commit into
cheggaaa:masterfrom
petrvaganoff:svace-ICS-51660

Conversation

@petrvaganoff

Copy link
Copy Markdown
Contributor

Found by the static analyzer Svace (ISP RAS): DIVISION_BY_ZERO.EX.

Variable cursorLen, whose possible value set allows a zero value at pb.go:368 by calling function 'gopkg.in/cheggaaa/pb.v1.escapeAwareRuneCountInString', is used as a denominator at pb.go:370.

Variable cursorLen, whose possible value set allows a zero value at pb.go:368 by calling function 'gopkg.in/cheggaaa/pb.v1.escapeAwareRuneCountInString', is used as a denominator at pb.go:373.

Variable emptyLen, whose possible value set allows a zero value at pb.go:378 by calling function 'gopkg.in/cheggaaa/pb.v1.escapeAwareRuneCountInString', is used as a denominator at pb.go:379.

Found by the static analyzer Svace (ISP RAS): DIVISION_BY_ZERO.EX.

Variable cursorLen, whose possible value set allows a zero value at pb.go:368
by calling function 'gopkg.in/cheggaaa/pb.v1.escapeAwareRuneCountInString',
is used as a denominator at pb.go:370.

Variable cursorLen, whose possible value set allows a zero value at pb.go:368
by calling function 'gopkg.in/cheggaaa/pb.v1.escapeAwareRuneCountInString',
is used as a denominator at pb.go:373.

Variable emptyLen, whose possible value set allows a zero value at pb.go:378
by calling function 'gopkg.in/cheggaaa/pb.v1.escapeAwareRuneCountInString',
is used as a denominator at pb.go:379.

Signed-off-by: Petr Vaganov <petrvaganoff@gmail.com>
@cheggaaa cheggaaa merged commit de94e0a into cheggaaa:master Jun 9, 2026
1 check 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.

2 participants