]> Cypherpunks repositories - gostls13.git/commit
compress/gzip: fix stack exhaustion bug in Reader.Read
authorTatiana Bradley <tatiana@golang.org>
Fri, 6 May 2022 15:25:06 +0000 (11:25 -0400)
committerMichael Knyszek <mknyszek@google.com>
Tue, 12 Jul 2022 15:06:07 +0000 (15:06 +0000)
commitb2b8872c876201eac2d0707276c6999ff3eb185e
tree2639c33ab570d4b7db9fcfe650cea861bd8259d1
parentac68c6c683409f98250d34ad282b9e1b0c9095ef
compress/gzip: fix stack exhaustion bug in Reader.Read

Replace recursion with iteration in Reader.Read to avoid stack
exhaustion when there are a large number of files.

Fixes CVE-2022-30631
Fixes #53168

Change-Id: I47d8afe3f2d40b0213ab61431df9b221794dbfe0
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1455673
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/417067
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/compress/gzip/gunzip.go
src/compress/gzip/gunzip_test.go