X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=pb_decode.c;h=e2e89a0dfb3f7c70fe415c8e459538a5e6231915;hb=60109c0be1c8b21b38f08b50db36577921eaca7f;hp=bc6df7b978a138cd8026ba30fb5338bb5d71df63;hpb=41f98343c8e4c94180b514902219044510a234b1;p=apps%2Fagl-service-can-low-level.git diff --git a/pb_decode.c b/pb_decode.c index bc6df7b9..e2e89a0d 100644 --- a/pb_decode.c +++ b/pb_decode.c @@ -571,7 +571,7 @@ bool checkreturn pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[ } while (pb_field_next(&iter)); /* Fixup if last field was also required. */ - if (PB_HTYPE(last_type) == PB_HTYPE_REQUIRED) + if (PB_HTYPE(last_type) == PB_HTYPE_REQUIRED && iter.current->tag) req_field_count++; /* Check the whole bytes */