Skip to content

Commit

Permalink
Detect unterminated regex when EOF reached
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-rushakoff committed Jul 12, 2016
1 parent d048501 commit 3bd61c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bugfixes

- [#710](https://github.com/influxdata/kapacitor/pull/662): Fix infinite loop when parsing unterminated regex in TICKscript.

## v1.0.0-beta3 [2016-07-09]

### Release Notes
Expand Down
2 changes: 2 additions & 0 deletions tick/ast/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ func lexRegex(l *lexer) stateFn {
case r == '/':
l.emit(TokenRegex)
return lexToken
case r == eof:
return l.errorf("unterminated regex")
default:
//absorb
}
Expand Down

0 comments on commit 3bd61c8

Please sign in to comment.