Found the problem file.

NOW TO DEBUG
This commit is contained in:
Caleb Gardner
2022-06-18 06:46:00 -05:00
parent 9ac8fef3b2
commit 96b38935a6
3 changed files with 11 additions and 5 deletions
+3 -3
View File
@@ -290,9 +290,9 @@ func TestSTUFF(t *testing.T) {
if err != nil {
t.Fatal(err)
}
os.Remove(wd + "/testing/test.txt")
testOut, _ := os.Create(wd + "/testing/test.txt")
testFil, err := rdr.Open("PortableApps/Notepad++Portable/App/Readme.txt")
os.Remove(wd + "/testing/test.xml")
testOut, _ := os.Create(wd + "/testing/test.xml")
testFil, err := rdr.Open("PortableApps/Notepad++Portable/App/Notepad++64/functionList/cobol-free.xml")
if err != nil {
t.Fatal(err)
}
+6
View File
@@ -2,6 +2,8 @@ package metadata
import (
"encoding/binary"
"errors"
"fmt"
"io"
"github.com/CalebQ42/squashfs/internal/decompress"
@@ -36,6 +38,10 @@ func (r *Reader) Advance() error {
}
comp := size&0x8000 != 0x8000
size &^= 0x8000
if size > 8196 {
fmt.Println("uhoh")
return errors.New("AH")
}
r.cur = io.LimitReader(r.master, int64(size))
if comp {
r.cur, err = r.d.Reader(r.cur)
+2 -2
View File
@@ -72,8 +72,8 @@ func TestExtractQuick(t *testing.T) {
}
op := squashfs.DefaultOptions()
op.Verbose = true
sub :=
err = rdr.ExtractWithOptions(libPath, op)
sub, _ := rdr.Sub("PortableApps/Notepad++Portable/App/Notepad++64/functionList")
err = sub.(*squashfs.FS).ExtractWithOptions(libPath, op)
if err != nil {
t.Fatal(err)
}