Skip to content

Commit

Permalink
Set the stream limit to the length of the data.
Browse files Browse the repository at this point in the history
- Mark all conformance tests as now passing.
  • Loading branch information
thomasvl committed Nov 23, 2015
1 parent 4e33881 commit ba800e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions conformance/failure_list_objc.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
# No tests currently failing.
6 changes: 1 addition & 5 deletions objectivec/GPBCodedInputStream.m
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,6 @@ void GPBCodedInputStreamPopLimit(GPBCodedInputStreamState *state,
}

size_t GPBCodedInputStreamBytesUntilLimit(GPBCodedInputStreamState *state) {
if (state->currentLimit == SIZE_T_MAX) {
return state->currentLimit;
}

return state->currentLimit - state->bufferPos;
}

Expand Down Expand Up @@ -299,7 +295,7 @@ - (instancetype)initWithData:(NSData *)data {
buffer_ = [data retain];
state_.bytes = (const uint8_t *)[data bytes];
state_.bufferSize = [data length];
state_.currentLimit = NSUIntegerMax;
state_.currentLimit = state_.bufferSize;
}
return self;
}
Expand Down

0 comments on commit ba800e2

Please sign in to comment.