-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3112 from graphql-java/prevent-stackoverflow-in-p…
…arser Preventing stack overflow exceptions via limiting the depth of the parser rules
- Loading branch information
Showing
6 changed files
with
297 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/graphql/parser/exceptions/ParseCancelledTooDeepException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package graphql.parser.exceptions; | ||
|
||
import graphql.Internal; | ||
import graphql.i18n.I18n; | ||
import graphql.language.SourceLocation; | ||
import graphql.parser.InvalidSyntaxException; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Internal | ||
public class ParseCancelledTooDeepException extends InvalidSyntaxException { | ||
|
||
@Internal | ||
public ParseCancelledTooDeepException(@NotNull I18n i18N, @Nullable SourceLocation sourceLocation, @Nullable String offendingToken, int maxTokens, @NotNull String tokenType) { | ||
super(i18N.msg("ParseCancelled.tooDeep", maxTokens, tokenType), | ||
sourceLocation, offendingToken, null, null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.