Git Product home page Git Product logo

xz's People

Contributors

xi2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xz's Issues

panic: runtime error: index out of range in bcjX86Filter

package main

import (
    "bytes"
    "encoding/hex"
    "fmt"
    "io/ioutil"

    "xi2.org/x/xz"
)

func main() {
    in, err := hex.DecodeString(`fd377a585a000004e6d6b4460201040021010800d2b974cbe0303030305d3030914584683bdedea84b03d83553a49173a3e51b1e5b1d4af106c1ae79ea4562760c29cd4bafb0003030303030303030303030303030303030303030303030`)
    if err != nil {
        panic(err)
    }

    r, err := xz.NewReader(bytes.NewReader(in), 0)
    if err != nil {
        fmt.Println(err)
    }
    _, err = ioutil.ReadAll(r)
    if err != nil {
        fmt.Println(err)
    }
}
panic: runtime error: index out of range [recovered]
    panic: runtime error: index out of range

goroutine 1 [running]:
io/ioutil.readAll.func1(0xc82003be48)
    /src/go/src/io/ioutil/ioutil.go:30 +0x11e
xi2.org/x/xz.bcjX86Filter(0xc820054070, 0xc82009a000, 0x49, 0x2000, 0x10000)
    /go/src/xi2.org/x/xz/dec_bcj.go:111 +0x3eb
xi2.org/x/xz.bcjApply(0xc820054070, 0xc82009a000, 0x49, 0x2000, 0xc82003ba40)
    /go/src/xi2.org/x/xz/dec_bcj.go:289 +0x8b
xi2.org/x/xz.xzDecBCJRun(0xc820054070, 0xc82009e000, 0xc82005a0c0, 0x10000)
    /go/src/xi2.org/x/xz/dec_bcj.go:370 +0x4fa
xi2.org/x/xz.decBlock(0xc82009c000, 0xc82005a0c0, 0xc82007b801)
    /go/src/xi2.org/x/xz/dec_stream.go:251 +0x7a
xi2.org/x/xz.decMain(0xc82009c000, 0xc82005a0c0, 0x5e)
    /go/src/xi2.org/x/xz/dec_stream.go:651 +0x56b
xi2.org/x/xz.xzDecRun(0xc82009c000, 0xc82005a0c0, 0x2000)
    /go/src/xi2.org/x/xz/dec_stream.go:755 +0x41
xi2.org/x/xz.(*Reader).decode(0xc8200a6000, 0xc8200a6020)
    /go/src/xi2.org/x/xz/reader.go:117 +0x2c9
xi2.org/x/xz.(*Reader).Read(0xc8200a6000, 0xc8200b4000, 0x200, 0x200, 0x0, 0x0, 0x0)
    /go/src/xi2.org/x/xz/reader.go:163 +0x370
bytes.(*Buffer).ReadFrom(0xc82003bda0, 0x7f0d9782d1e8, 0xc8200a6000, 0x0, 0x0, 0x0)
    /src/go/src/bytes/buffer.go:173 +0x23f
io/ioutil.readAll(0x7f0d9782d1e8, 0xc8200a6000, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
    /src/go/src/io/ioutil/ioutil.go:33 +0x154
io/ioutil.ReadAll(0x7f0d9782d1e8, 0xc8200a6000, 0x0, 0x0, 0x0, 0x0, 0x0)
    /src/go/src/io/ioutil/ioutil.go:42 +0x51
main.main()
    /t.go:22 +0x277
exit status 2

found using https://github.com/dvyukov/go-fuzz.

403 error when accessing package

When attempting to download this package with go get it returns an error.

Input

GO111MODULE=on go get github.com/xi2/[email protected]

Output

go: downloading github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
go get github.com/xi2/[email protected]: github.com/xi2/[email protected]: reading https://proxy.golang.org/github.com/xi2/xz/@v/v0.0.0-20171230120015-48954b6210f8.zip: 403 ruleengineerror

xi2.org is unreachable

xi2.org is currently unreachable, meaning that it's not possible to sucessfully run go get xi2.org/x/xz.

memory leak

There is a memory leak. When I decompressed all the kernel modules for analysis(about 2500 xz files), the VmRSS occupancy increased to 200M

License

Are you able to update the license to a standard one such as MIT or Apache 2?

Complete support for all XZ filters

For full XZ support, package xz is currently missing the following features:

  • Support for full length filter chains (up to 4 filters)
  • Support for the "delta" filter
  • Support for a non-zero start offset for BCJ filters

These features appear to be little used, but xz should support them ASAP so that package users can add "xz support" to their programs without needing to specify caveats about subformats.

Also test files should be added exercising all the above.

@klauspost

Support 4GB dictionary size

Package xz currently supports an LZMA2 dictionary size up to 3072 MiB, but the xz specification says it can go up to 4096 MiB - 1 B. Although unlikely in practice, this should be supported for completeness.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.