Skip to content

Add tests for integer overflow when a signed 32-bit integer is used for holding the numeric character reference value. #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions tokenizer/numericEntities.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
{"tests": [

{"description": "Invalid unterminated numeric entity character overflow before EOF",
"input": "&#11111111111",
"output": ["ParseError", "ParseError", ["Character", "\uFFFD"]]},

{"description": "Invalid unterminated numeric entity character overflow before EOF",
"input": "&#1111111111",
"output": ["ParseError", "ParseError", ["Character", "\uFFFD"]]},

{"description": "Invalid unterminated numeric entity character overflow before EOF",
"input": "&#111111111111",
"output": ["ParseError", "ParseError", ["Character", "\uFFFD"]]},

{"description": "Invalid unterminated numeric entity character overflow",
"input": "&#11111111111x",
"output": ["ParseError", "ParseError", ["Character", "\uFFFDx"]]},

{"description": "Invalid unterminated numeric entity character overflow",
"input": "&#1111111111x",
"output": ["ParseError", "ParseError", ["Character", "\uFFFDx"]]},

{"description": "Invalid unterminated numeric entity character overflow",
"input": "&#111111111111x",
"output": ["ParseError", "ParseError", ["Character", "\uFFFDx"]]},

{"description": "Invalid numeric entity character overflow",
"input": "�",
"output": ["ParseError", ["Character", "\uFFFD"]]},

{"description": "Invalid numeric entity character overflow",
"input": "�",
"output": ["ParseError", ["Character", "\uFFFD"]]},

{"description": "Invalid numeric entity character overflow",
"input": "�",
"output": ["ParseError", ["Character", "\uFFFD"]]},

{"description": "Invalid numeric entity character U+0000",
"input": "�",
"output": ["ParseError", ["Character", "\uFFFD"]]},
Expand Down
69 changes: 69 additions & 0 deletions tree-construction/entities01.dat
Original file line number Diff line number Diff line change
Expand Up @@ -721,3 +721,72 @@ FOO�ZOO
| <head>
| <body>
| "FOO�ZOO"

#data
FOO&#11111111111
#errors
(1,3): expected-doctype-but-got-chars
(1,13): illegal-codepoint-for-numeric-entity
(1,13): eof-in-numeric-entity
#document
| <html>
| <head>
| <body>
| "FOO�"

#data
FOO&#1111111111
#errors
(1,3): expected-doctype-but-got-chars
(1,13): illegal-codepoint-for-numeric-entity
(1,13): eof-in-numeric-entity
#document
| <html>
| <head>
| <body>
| "FOO�"

#data
FOO&#111111111111
#errors
(1,3): expected-doctype-but-got-chars
(1,13): illegal-codepoint-for-numeric-entity
(1,13): eof-in-numeric-entity
#document
| <html>
| <head>
| <body>
| "FOO�"

#data
FOO&#11111111111ZOO
#errors
(1,3): expected-doctype-but-got-chars
(1,13): illegal-codepoint-for-numeric-entity
#document
| <html>
| <head>
| <body>
| "FOO�ZOO"

#data
FOO&#1111111111ZOO
#errors
(1,3): expected-doctype-but-got-chars
(1,13): illegal-codepoint-for-numeric-entity
#document
| <html>
| <head>
| <body>
| "FOO�ZOO"

#data
FOO&#111111111111ZOO
#errors
(1,3): expected-doctype-but-got-chars
(1,13): illegal-codepoint-for-numeric-entity
#document
| <html>
| <head>
| <body>
| "FOO�ZOO"