From: Petteri Aimonen Date: Tue, 31 Jul 2012 16:12:57 +0000 (+0300) Subject: Fix bug in decoder with packed arrays. X-Git-Tag: 3.99.1~14^2~476 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=b582bc9bf699ee76f8634c3c7b7aa1ec0a0afb08;p=apps%2Flow-level-can-service.git Fix bug in decoder with packed arrays. Update issue 23 Status: FixedInGit --- diff --git a/pb_decode.c b/pb_decode.c index 18941cb..6d3a0b6 100644 --- a/pb_decode.c +++ b/pb_decode.c @@ -288,6 +288,7 @@ static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_t && PB_LTYPE(iter->current->type) <= PB_LTYPE_LAST_PACKABLE) { /* Packed array */ + bool status; size_t *size = (size_t*)iter->pSize; pb_istream_t substream; if (!make_string_substream(stream, &substream)) @@ -300,7 +301,9 @@ static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_t return false; (*size)++; } - return (substream.bytes_left == 0); + status = (substream.bytes_left == 0); + stream->state = substream.state; + return status; } else {