Patch suggestion:
Replace the code at lines 406-415 with the following code:
if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE &&
*(pb_size_t*)iter->pSize != iter->pos->tag)
{
/* We memset to zero so that any callbacks are set to NULL.
* This is because the callbacks might otherwise have values
* from some other union field. */
memset(iter->pData, 0, iter->pos->data_size);
pb_message_set_to_defaults((const pb_field_t*)iter->pos->ptr, iter->pData);
}
*(pb_size_t*)iter->pSize = iter->pos->tag;
return func(stream, iter->pos, iter->pData);
Contact me: weitingcai2020@gmail.com
References:
Patch suggestion: Replace the code at lines 406-415 with the following code: