mirror of
git://sourceware.org/git/bzip2.git
synced 2024-11-23 11:43:28 +08:00
bzip2recover: Fix buffer overflow for large argv[0].
bzip2recover.c (main) copies argv[0] to a statically sized buffer without checking whether argv[0] might be too big (> 2000 chars). This patch comes from Fedora and was originally reported at https://bugzilla.redhat.com/show_bug.cgi?id=226979
This commit is contained in:
parent
02fe3ca234
commit
833548edc0
@ -309,7 +309,8 @@ Int32 main ( Int32 argc, Char** argv )
|
||||
UInt32 buffHi, buffLo, blockCRC;
|
||||
Char* p;
|
||||
|
||||
strcpy ( progName, argv[0] );
|
||||
strncpy ( progName, argv[0], BZ_MAX_FILENAME-1);
|
||||
progName[BZ_MAX_FILENAME-1]='\0';
|
||||
inFileName[0] = outFileName[0] = 0;
|
||||
|
||||
fprintf ( stderr,
|
||||
|
Loading…
Reference in New Issue
Block a user