ckolivas / lrzip

Long Range Zip
http://lrzip.kolivas.org
GNU General Public License v2.0
619 stars 76 forks source link

Correct adding slash to control->tmpdir. off-by-one error. #38

Closed pete4abw closed 9 years ago

pete4abw commented 9 years ago

off by one error. sorry...

ckolivas commented 9 years ago

:(

pete4abw commented 9 years ago

Not a fatal error. Just will create two slashes if the tmpdir had a trailing slash. If tmpdir had no trailing slash, no problem.

ckolivas commented 9 years ago

Phew, I just released a version. Two slashes are harmless.

pete4abw commented 9 years ago

It was late. Here's debug output.

1283 if (control->tmpdir[len] != '/') 2: control->tmpdir = 0x659060 "/tmp/dir/" 1: eptr = 0x7fffffffee0b "/tmp/dir/" (gdb) n 1284 control->tmpdir[len] = '/'; /* need a trailing slash */ 2: control->tmpdir = 0x659060 "/tmp/dir/" 1: eptr = 0x7fffffffee0b "/tmp/dir/" (gdb) n 1285 control->tmpdir[len+1] = '\0'; 2: control->tmpdir = 0x659060 "/tmp/dir//" 1: eptr = 0x7fffffffee0b "/tmp/dir/" (gdb) n 1287 return true; 2: control->tmpdir = 0x659060 "/tmp/dir//" 1: eptr = 0x7fffffffee0b "/tmp/dir/" (gdb) n 1288 } 2: control->tmpdir = 0x659060 "/tmp/dir//" 1: eptr = 0x7fffffffee0b "/tmp/dir/"