Skip to content

Commit

Permalink
Fix decoding of overencoded booleans.
Browse files Browse the repository at this point in the history
if the value was >32bit with the low bits all being zero, it was decoded as
false instead of as true.

Fixes protocolbuffers#6863
  • Loading branch information
thomasvl committed Nov 8, 2019
1 parent f6eeb43 commit d0ed756
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion objectivec/GPBCodedInputStream.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int64_t GPBCodedInputStreamReadSInt64(GPBCodedInputStreamState *state) {
}

BOOL GPBCodedInputStreamReadBool(GPBCodedInputStreamState *state) {
return ReadRawVarint32(state) != 0;
return ReadRawVarint64(state) != 0;
}

int32_t GPBCodedInputStreamReadTag(GPBCodedInputStreamState *state) {
Expand Down

0 comments on commit d0ed756

Please sign in to comment.