Fixes #27: Reject full 00 - 1F unicode range

This commit is contained in:
Thomas Pelletier
2015-07-16 21:51:41 -07:00
parent 8fc7451ffc
commit cf5ad6a245
2 changed files with 36 additions and 5 deletions
+5 -1
View File
@@ -423,7 +423,11 @@ func (l *tomlLexer) lexString() tomlLexStateFn {
return l.errorf("invalid escape sequence: \\" + string(l.peek()))
}
} else {
growingString += string(l.peek())
r := l.peek()
if 0x00 <= r && r <= 0x1F {
return l.errorf("unescaped control character %U", r)
}
growingString += string(r)
}
if l.next() == eof {