Source/WebCore:
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jun 2015 17:23:00 +0000 (17:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jun 2015 17:23:00 +0000 (17:23 +0000)
commit77260ff9d57fab38ce14b755e73368b83058b077
tree7c14704251769bb7d42ddcc0fa4932d686f1e1d5
parent112116e36a9f3791fba6deca47318c1086ae9134
Source/WebCore:
[Content Extensions] Limit number of rules.
https://bugs.webkit.org/show_bug.cgi?id=145663

Patch by Alex Christensen <achristensen@webkit.org> on 2015-06-15
Reviewed by Benjamin Poulain.

Added an API test to make sure that parsing fails when there are too many rules.

* contentextensions/ContentExtensionError.cpp:
(WebCore::ContentExtensions::contentExtensionErrorCategory):
* contentextensions/ContentExtensionError.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadEncodedRules):
Fail to parse a content extension with more than 50000 rules.

Tools:
[Content Extensions] Make max NFA size and max rule count user defaults.
https://bugs.webkit.org/show_bug.cgi?id=145663

Patch by Alex Christensen <achristensen@webkit.org> on 2015-06-15
Reviewed by Benjamin Poulain.

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/contentextensions/ContentExtensionError.cpp
Source/WebCore/contentextensions/ContentExtensionError.h
Source/WebCore/contentextensions/ContentExtensionParser.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp