Skip to content

Commit

Permalink
zstd: remove unreachable debugging code raising insecure_file_permiss…
Browse files Browse the repository at this point in the history
…ions security detection (#1022)
  • Loading branch information
sam9291 authored Nov 4, 2024
1 parent 3915ad5 commit 826a08c
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions zstd/blockdec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
package zstd

import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"hash/crc32"
"io"
"os"
"path/filepath"
"sync"

"github.com/klauspost/compress/huff0"
Expand Down Expand Up @@ -648,21 +644,6 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) {
println("initializing sequences:", err)
return err
}
// Extract blocks...
if false && hist.dict == nil {
fatalErr := func(err error) {
if err != nil {
panic(err)
}
}
fn := fmt.Sprintf("n-%d-lits-%d-prev-%d-%d-%d-win-%d.blk", hist.decoders.nSeqs, len(hist.decoders.literals), hist.recentOffsets[0], hist.recentOffsets[1], hist.recentOffsets[2], hist.windowSize)
var buf bytes.Buffer
fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.litLengths.fse))
fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.matchLengths.fse))
fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.offsets.fse))
buf.Write(in)
os.WriteFile(filepath.Join("testdata", "seqs", fn), buf.Bytes(), os.ModePerm)
}

return nil
}
Expand Down

0 comments on commit 826a08c

Please sign in to comment.