Summary: | In theory, uncompress(1) may crash and SEGV | ||
---|---|---|---|
Product: | Base System | Reporter: | David Jones <drj> |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | emaste, imp, ngie |
Priority: | Normal | ||
Version: | 1.0-CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
David Jones
2008-10-07 10:20:01 UTC
This is the line that the OP is suggesting have a conditional added to it: https://svnweb.freebsd.org/base/head/usr.bin/compress/zopen.c?revision=146336&view=markup&pathrev=146336#l619 . For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open" A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=818c7b769a4f7d3c8fecc4cf491f4e22ef816eba commit 818c7b769a4f7d3c8fecc4cf491f4e22ef816eba Author: David Jones <drj@ravenbrook.com> AuthorDate: 2024-10-11 15:49:17 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 15:50:09 +0000 uncompress: Avoid reading an extra byte When reading the next code in a stream, avoid reading an extra byte if we're going to throw it away. When there's no more bits to extract from the stream, bits will be 0 and we'll mask the read byte with 0 anyway. At worst, this will avoid reading one past the end of gbuf array (which is not possible in well formed streams). PR: 127912 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47041 usr.bin/compress/zopen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=03b4f232354ce68fe1cb462038654f6527f63579 commit 03b4f232354ce68fe1cb462038654f6527f63579 Author: David Jones <drj@ravenbrook.com> AuthorDate: 2024-10-11 15:49:17 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:11:02 +0000 uncompress: Avoid reading an extra byte When reading the next code in a stream, avoid reading an extra byte if we're going to throw it away. When there's no more bits to extract from the stream, bits will be 0 and we'll mask the read byte with 0 anyway. At worst, this will avoid reading one past the end of gbuf array (which is not possible in well formed streams). PR: 127912 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47041 (cherry picked from commit 818c7b769a4f7d3c8fecc4cf491f4e22ef816eba) usr.bin/compress/zopen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7e229794ca37d25265b0472bce26e8fd2b9bee2c commit 7e229794ca37d25265b0472bce26e8fd2b9bee2c Author: David Jones <drj@ravenbrook.com> AuthorDate: 2024-10-11 15:49:17 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:12:41 +0000 uncompress: Avoid reading an extra byte When reading the next code in a stream, avoid reading an extra byte if we're going to throw it away. When there's no more bits to extract from the stream, bits will be 0 and we'll mask the read byte with 0 anyway. At worst, this will avoid reading one past the end of gbuf array (which is not possible in well formed streams). PR: 127912 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47041 (cherry picked from commit 818c7b769a4f7d3c8fecc4cf491f4e22ef816eba) usr.bin/compress/zopen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) |