Menu

#225 segment default happened in handing the rarfile under the speical case

v1.0 (example)
open
my p7zip
None
5
2019-10-08
2019-09-30
SHINE SUN
No

I use the p7zip to unrar the rar file and I received a coredump at result.

example:
➜ libp7zip ✗ unrar l archive/res.rar

UNRAR 5.01 freeware Copyright (c) 1993-2013 Alexander Roshal

Archive: archive/res.rar
Details: RAR 4

Attributes Size Date Time Name


-rw-r--r-- 161100 19-09-19 13:10 24807202_1.html
-rw-r--r-- 264 02-07-18 10:19 readme.txt
-rw-r--r-- 410 19-09-19 19:44 031849971.gif


I used the NULL password to unarchive to handle this archive. Theoretically it works normally ,and it tells me that I use the wrong password. But it caused the coredump.

with assistance of the gdb,I know something about the wrong function call.

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs x64)

Scanning the drive for archives:
1 file, 56598 bytes (56 KiB)

Extracting archive: archive/res.rar

Path = archive/res.rar
Type = Rar
Physical Size = 56598
Solid = -
Blocks = 3
Multivolume = -
Volumes = 1

Enter password (will not be echoed):
/usr/local/bin/7z: 行 2: 4703 段错误 "/usr/local/lib/p7zip/7z" "$@"

#0  0x00007fffefe3326f in NCompress::NRar2::CDecoder::ReadTables() () from /usr/lib64/Codecs/Rar.so
#1  0x00007fffefe34a72 in NCompress::NRar2::CDecoder::CodeReal(ISequentialInStream*, ISequentialOutStream*, unsigned long long const*, unsigned long long const*, ICompressProgressInfo*) ()
   from /usr/lib64/Codecs/Rar.so
#2  0x00007fffefe34bde in NCompress::NRar2::CDecoder::Code(ISequentialInStream*, ISequentialOutStream*, unsigned long long const*, unsigned long long const*, ICompressProgressInfo*) ()
   from /usr/lib64/Codecs/Rar.so
#3  0x00007ffff0180cc6 in NArchive::NRar::CHandler::Extract(unsigned int const*, unsigned int, int, IArchiveExtractCallback*) () from /lib64/7z.so
#4  0x00000000004b4c70 in C7ZipArchiveImpl::Extract (this=0x727be0, pArchiveItem=0x728b20, pOutStream=0x7fffffffd500)

the p7zip version is 16.02 ,the lasttest version of p7zip. so i don't know how to fix the bug, but i use the true password to unarchive the archive, it works normally.

1 Attachments

Discussion

  • Igor Pavlov

    Igor Pavlov - 2019-09-30

    Please write exact command with failure:
    For example:

    7z t res.rar -pNULL
    7z t res.rar -pNULL 24807202_1.html
    

    16.02 is old version.
    Probably I've fixed these bugs in main 7-Zip code.
    p7zip was not updated.

     
  • SHINE SUN

    SHINE SUN - 2019-10-08

    now I use the c++ programs language to reslove the archive files(using 7z.so and Rar.so),how can I get the latest the version of p7zip source file?

    the https://www.7-zip.org/download.html is latest ?

     

    Last edit: SHINE SUN 2019-10-08

Log in to post a comment.

MongoDB Logo MongoDB