diff options
| author | Naveed Khan <naveed@digiscrypt.com> | 2026-06-22 02:39:41 +0530 |
|---|---|---|
| committer | Mark Wielaard <mark@klomp.org> | 2026-06-22 00:37:44 +0200 |
| commit | f153ef257a8e8901d8f8ed96fd1a2467806e8755 (patch) | |
| tree | 5aff4e491d88408493934fdc4da7db837515d36c /README.COMPILATION.PROBLEMS | |
| parent | 9515e7ff78facd349ba3d86a637be71acaccc02e (diff) | |
| download | bzip2-f153ef257a8e8901d8f8ed96fd1a2467806e8755.tar.gz bzip2-f153ef257a8e8901d8f8ed96fd1a2467806e8755.tar.bz2 bzip2-f153ef257a8e8901d8f8ed96fd1a2467806e8755.zip | |
bzip2recover: Check argc >= 1 && argv[0] != NULL
main() initialises progName by copying argv[0] with strncpy before argc
is examined. When the program is started with an empty argument vector
(argc == 0 and argv[0] == NULL), for example through
execve(path, (char*[]){ NULL }, envp), this dereferences a NULL pointer
and bzip2recover crashes with SIGSEGV before any argument checking
happens.
Guard the use of argv[0] and fall back to a hard coded "bzip2recover"
string, mirroring the fix already applied to bzip2.c in commit
af79253677ad ("bzip2.c: Check argc >= 1 && argv[0] != NULL").
Diffstat (limited to 'README.COMPILATION.PROBLEMS')
0 files changed, 0 insertions, 0 deletions
