mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00:00
caddyfile: Reject long heredoc markers (#6098)
Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
parent
c78ebb3d6a
commit
e7a534d0a3
4 changed files with 40 additions and 10 deletions
|
|
@ -149,6 +149,10 @@ func (l *lexer) next() (bool, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
if len(val) > 32 {
|
||||
return false, fmt.Errorf("heredoc marker too long on line #%d: %s", l.line, string(val))
|
||||
}
|
||||
|
||||
// after hitting a newline, we know that the heredoc marker
|
||||
// is the characters after the two << and the newline.
|
||||
// we reset the val because the heredoc is syntax we don't
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue