Skip to content

Commit 7184815

Browse files
committed
Preparation of release v0.5.14
The commit includes preparations for the release v0.5.14 including go fmt, release notes and updates to TODO.md.
1 parent 88ddf1d commit 7184815

5 files changed

Lines changed: 15 additions & 12 deletions

File tree

TODO.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
# TODO list
22

3-
## Release v0.5.14
4-
5-
* If the DictionarySize is larger than the UncompressedSize set it to
6-
UncompressedSize
7-
* make a Header() (h Header, ok bool) function so the user can implement its own
8-
policy
9-
* Add documentation to Reader to explain the situation
10-
* Add a TODO for the rewrite version
11-
123
## Release v0.6
134

145
1. Review encoder and check for lzma improvements under xz.
@@ -91,6 +82,13 @@
9182

9283
## Log
9384

85+
## 2025-08-28
86+
87+
Release v0.5.14 addresses the security vulnerability CVE-2025-58058. If you put
88+
bytes in from of a LZMA stream, the header might not be read correctly and
89+
memory for the dictionary buffer allocated. I have implemented mitigations for
90+
the problem.
91+
9492
### 2025-08-20
9593

9694
Release v0.5.13 addressed issue #61 regarding handling of multiple WriteClosers

doc/relnotes/release-v0.5.14.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release Notes v0.5.14
2+
3+
This release addresses security vulnerability CVE-2025-58058. It implements a
4+
number of mitigation for a resource leak problem. It needs to only to be updated
5+
if lzma.NewWriter is used.

lzma/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
// ReaderConfig stores the parameters for the reader of the classic LZMA
2020
// format.
2121
type ReaderConfig struct {
22-
// Since v0.5.14 this parameter sets an upper limit for a .lzma file's
22+
// Since v0.5.14 this parameter sets an upper limit for a .lzma file's
2323
// dictionary size. This helps to mitigate problems with mangled
2424
// headers.
2525
DictCap int

lzma/reader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func TestZeroPrefixIssue(t *testing.T) {
377377
}
378378
h, ok := l.Header()
379379
t.Logf("Header %+v ok %v", h, ok)
380-
actualDictSize := len(l.d.Dict.buf.data)-1
380+
actualDictSize := len(l.d.Dict.buf.data) - 1
381381
t.Logf("Actual dictionary size: %d", actualDictSize)
382382
if actualDictSize > MinDictCap && h.Size >= 0 &&
383383
h.Size < int64(actualDictSize) {

lzma/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// MinDictCap and MaxDictCap provide the range of supported dictionary
1414
// capacities.
1515
const (
16-
MinDictCap = 1 << 12
16+
MinDictCap = 1 << 12
1717
MaxDictCap = 1<<32 - 1
1818
)
1919

0 commit comments

Comments
 (0)