Skip to content

zlib: avoid signed shift in inflatePrime - #1091

Merged
steadytao merged 1 commit into
RsyncProject:masterfrom
samitistfobos-dev:fix/1090-inflateprime-signed-shift-overflow
Sep 16, 2026
Merged

steadytao merged 1 commit into
RsyncProject:masterfrom
samitistfobos-dev:fix/1090-inflateprime-signed-shift-overflow

Conversation

@samitistfobos-dev

@samitistfobos-dev samitistfobos-dev commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Problem:
The value of an arithmetic expression 'value << state->bits' is a subject to overflow because its operands are not cast to a larger data type before performing arithmetic

Solution: Cast value to unsigned long before the left shift to prevent signed integer overflow during shift evaluation.
Signed-off-by: a.burlakov@fobos-nt.ru
Signed-off-by: rx1513@altlinux.org

Pull request for issue #1090 .

Problem:
The value of an arithmetic expression 'value << state->bits' is a subject to overflow because its operands are not cast to a larger data type before performing arithmetic
Solution: Cast value to unsigned long before the left shift to prevent signed integer overflow during shift evaluation.
Signed-off-by: a.burlakov@fobos-nt.ru
@steadytao steadytao changed the title Fix: NO_CAST.INTEGER_OVERFLOW zlib: avoid signed shift in inflatePrime Sep 16, 2026
@steadytao
steadytao merged commit ad79af2 into RsyncProject:master Sep 16, 2026
20 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.

2 participants