From d2e3c1ad930efbee0ab4839124522da94f70ada4 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Sat, 9 Mar 2013 12:35:07 +0200 Subject: Fix bug with decoding empty message types. Add test for the same. Note: the bug only applies to empty message types. Empty messages of non-empty message types are not affected. Update issue 65 Status: FixedInGit --- pb_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pb_decode.c') 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 */ -- cgit 1.2.3-korg