Set the stream limit to the length of the data.

- Mark all conformance tests as now passing.
pull/1001/head
Thomas Van Lenten 9 years ago
parent 4e3388168d
commit ba800e2e57
  1. 3
      conformance/failure_list_objc.txt
  2. 6
      objectivec/GPBCodedInputStream.m

@ -1,2 +1 @@
ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE # No tests currently failing.
ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE

@ -264,10 +264,6 @@ void GPBCodedInputStreamPopLimit(GPBCodedInputStreamState *state,
} }
size_t GPBCodedInputStreamBytesUntilLimit(GPBCodedInputStreamState *state) { size_t GPBCodedInputStreamBytesUntilLimit(GPBCodedInputStreamState *state) {
if (state->currentLimit == SIZE_T_MAX) {
return state->currentLimit;
}
return state->currentLimit - state->bufferPos; return state->currentLimit - state->bufferPos;
} }
@ -299,7 +295,7 @@ void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state,
buffer_ = [data retain]; buffer_ = [data retain];
state_.bytes = (const uint8_t *)[data bytes]; state_.bytes = (const uint8_t *)[data bytes];
state_.bufferSize = [data length]; state_.bufferSize = [data length];
state_.currentLimit = NSUIntegerMax; state_.currentLimit = state_.bufferSize;
} }
return self; return self;
} }

Loading…
Cancel
Save