summaryrefslogtreecommitdiffstats
path: root/pb_decode.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2015-03-07 10:25:09 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2015-03-07 10:25:09 +0200
commitef422656a57b3f472b192691a40f48d0d72f2927 (patch)
treed6337dc04ed820deda96279ee00e3eb3d2e7775c /pb_decode.c
parent5c16a116ec2db9d19e42c5682cbfbf4f2b87ad87 (diff)
Fix oneof submessage initialization bug.
Update issue 149 Status: FixedInGit
Diffstat (limited to 'pb_decode.c')
-rw-r--r--pb_decode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pb_decode.c b/pb_decode.c
index 9d25dc61..4d8c7cbe 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -396,6 +396,10 @@ static bool checkreturn decode_static_field(pb_istream_t *stream, pb_wire_type_t
case PB_HTYPE_ONEOF:
*(pb_size_t*)iter->pSize = iter->pos->tag;
+ if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE)
+ {
+ pb_message_set_to_defaults((const pb_field_t*)iter->pos->ptr, iter->pData);
+ }
return func(stream, iter->pos, iter->pData);
default: