Skip to content

Commit

Permalink
CSS: prevent quasi-infinite recursion in background's append, from OS…
Browse files Browse the repository at this point in the history
…SFuzz
  • Loading branch information
tdewolff committed Feb 7, 2021
1 parent 210427e commit 2873b21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions css/css.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ func (c *cssMinifier) minifyTokens(prop Hash, values []Token) []Token {
}

func (c *cssMinifier) minifyProperty(prop Hash, values []Token) []Token {
// limit maximum to prevent slow recursions (e.g. for background's append)
if 100 < len(values) {
return values
}

switch prop {
case Font:
if len(values) > 1 { // must contain atleast font-size and font-family
Expand Down

0 comments on commit 2873b21

Please sign in to comment.