Parchive / par2cmdline

Official repo for par2cmdline and libpar2
http://parchive.sourceforge.net
GNU General Public License v2.0
723 stars 75 forks source link

Single Letter path crashes par2 #165

Open lkydev opened 3 years ago

lkydev commented 3 years ago

I stumbled across the following bug while creating a parity set.

Par2cmdline 0.8.1 FreeBSD 13.0 (x86) Debian 11.0 (x86) Debian 11.0 (x64) on WSL1 and WSL2.

# create a file named 'a' (a single letter)
$ dd if=/dev/urandom of=a bs=10000 count=100

# create a parity set
$ par2 c -s10000 -c100 test.par2 a

Block size: 10000
Source file count: 1
Source block count: 1000
Recovery block count: 100
Recovery file count: 7

Opening: a
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 1) >= this->size() (which is 1)
Aborted (core dumped)
animetosho commented 3 years ago

See #149