summaryrefslogtreecommitdiffstats
path: root/pb_decode.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-03-09 12:35:07 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-03-09 12:35:07 +0200
commitd2e3c1ad930efbee0ab4839124522da94f70ada4 (patch)
treebf9875dc44eb003841d59dbd3f1aba5186223bc7 /pb_decode.c
parent5522e02133be7d9dfd2f350f2774dfc0abc15686 (diff)
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
Diffstat (limited to 'pb_decode.c')
-rw-r--r--pb_decode.c2
1 files changed, 1 insertions, 1 deletions
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 */