You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
html/template.processUrlOnto calls bytes.Buffer.Grow with a desired target size, rather than with a desired growth amount, leading to memory usage doubling with each srcset element.
b.Grow(b.Cap() + len(s) + 16)
The text was updated successfully, but these errors were encountered:
mvdan
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Apr 6, 2018
What version of Go are you using (
go version
)?Go 1.10, on the playground
Does this issue reproduce with the latest release?
Yes, it's also present in
go version devel +542ea5ad91 Wed Apr 4 13:39:34 2018 -0700 darwin/amd64
What operating system and processor architecture are you using (
go env
)?The problem reproduces on the playground
What did you do?
https://play.golang.org/p/-Emmk7seW-_6
(Found via go-fuzz)
What did you expect to see?
What did you see instead?
https://github.com/golang/go/blob/go1.10.1/src/html/template/url.go#L91
html/template.processUrlOnto
callsbytes.Buffer.Grow
with a desired target size, rather than with a desired growth amount, leading to memory usage doubling with each srcset element.The text was updated successfully, but these errors were encountered: