aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBCodedInputStream.m
diff options
context:
space:
mode:
authorThomas Van Lenten <thomasvl@google.com>2017-03-28 09:10:20 -0400
committerThomas Van Lenten <thomasvl@google.com>2017-03-28 09:10:20 -0400
commitddb438855a9b9f349efe9025a03d1c6149ea072b (patch)
treee59ccf988d5491a891c99cac688fb2af846921c2 /objectivec/GPBCodedInputStream.m
parentd9e0119f2c2f49ea89012a03c030e2b5011d0bc3 (diff)
downloadprotobuf-ddb438855a9b9f349efe9025a03d1c6149ea072b.tar.gz
protobuf-ddb438855a9b9f349efe9025a03d1c6149ea072b.tar.bz2
protobuf-ddb438855a9b9f349efe9025a03d1c6149ea072b.zip
Raise the recursion limit to 100 to match other languages.
Diffstat (limited to 'objectivec/GPBCodedInputStream.m')
-rw-r--r--objectivec/GPBCodedInputStream.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/objectivec/GPBCodedInputStream.m b/objectivec/GPBCodedInputStream.m
index e8c8989c..eef05353 100644
--- a/objectivec/GPBCodedInputStream.m
+++ b/objectivec/GPBCodedInputStream.m
@@ -45,7 +45,12 @@ NSString *const GPBCodedInputStreamUnderlyingErrorKey =
NSString *const GPBCodedInputStreamErrorDomain =
GPBNSStringifySymbol(GPBCodedInputStreamErrorDomain);
-static const NSUInteger kDefaultRecursionLimit = 64;
+// Matching:
+// https://github.com/google/protobuf/blob/master/java/core/src/main/java/com/google/protobuf/CodedInputStream.java#L62
+// private static final int DEFAULT_RECURSION_LIMIT = 100;
+// https://github.com/google/protobuf/blob/master/src/google/protobuf/io/coded_stream.cc#L86
+// int CodedInputStream::default_recursion_limit_ = 100;
+static const NSUInteger kDefaultRecursionLimit = 100;
static void RaiseException(NSInteger code, NSString *reason) {
NSDictionary *errorInfo = nil;