aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@users.noreply.github.com>2015-11-05 18:41:05 -0800
committerJan Tattermusch <jtattermusch@users.noreply.github.com>2015-11-05 18:41:05 -0800
commitffe25c76eac55347d74bef508410f90f01f1db85 (patch)
treefa9638179b72bf9e763d1d76993f958546869301 /csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs
parent1470ced7ce6f8f5b42e0747ebbea1754db4a3310 (diff)
parent6fa17e759737e3225c6cc4ba830b921428c50781 (diff)
downloadprotobuf-ffe25c76eac55347d74bef508410f90f01f1db85.tar.gz
protobuf-ffe25c76eac55347d74bef508410f90f01f1db85.tar.bz2
protobuf-ffe25c76eac55347d74bef508410f90f01f1db85.zip
Merge pull request #941 from jskeet/recursion-limit
Add recursion limit handling to JSON parsing.
Diffstat (limited to 'csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs')
-rw-r--r--csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs b/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs
index 01d55395..cacda648 100644
--- a/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs
+++ b/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs
@@ -95,6 +95,13 @@ namespace Google.Protobuf
"Use CodedInputStream.SetRecursionLimit() to increase the depth limit.");
}
+ internal static InvalidProtocolBufferException JsonRecursionLimitExceeded()
+ {
+ return new InvalidProtocolBufferException(
+ "Protocol message had too many levels of nesting. May be malicious. " +
+ "Use JsonParser.Settings to increase the depth limit.");
+ }
+
internal static InvalidProtocolBufferException SizeLimitExceeded()
{
return new InvalidProtocolBufferException(