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 { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
os.Remove(wd + "/testing/test.txt") os.Remove(wd + "/testing/test.xml")
testOut, _ := os.Create(wd + "/testing/test.txt") testOut, _ := os.Create(wd + "/testing/test.xml")
testFil, err := rdr.Open("PortableApps/Notepad++Portable/App/Readme.txt") testFil, err := rdr.Open("PortableApps/Notepad++Portable/App/Notepad++64/functionList/cobol-free.xml")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
+6
View File
@@ -2,6 +2,8 @@ package metadata
import ( import (
"encoding/binary" "encoding/binary"
"errors"
"fmt"
"io" "io"
"github.com/CalebQ42/squashfs/internal/decompress" "github.com/CalebQ42/squashfs/internal/decompress"
@@ -36,6 +38,10 @@ func (r *Reader) Advance() error {
} }
comp := size&0x8000 != 0x8000 comp := size&0x8000 != 0x8000
size &^= 0x8000 size &^= 0x8000
if size > 8196 {
fmt.Println("uhoh")
return errors.New("AH")
}
r.cur = io.LimitReader(r.master, int64(size)) r.cur = io.LimitReader(r.master, int64(size))
if comp { if comp {
r.cur, err = r.d.Reader(r.cur) 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 := squashfs.DefaultOptions()
op.Verbose = true op.Verbose = true
sub := sub, _ := rdr.Sub("PortableApps/Notepad++Portable/App/Notepad++64/functionList")
err = rdr.ExtractWithOptions(libPath, op) err = sub.(*squashfs.FS).ExtractWithOptions(libPath, op)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }