Commit 8f7bae2c authored by Pavel Emelyanov's avatar Pavel Emelyanov

pb: Don't crash when showing empty repeated field

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 54f4f889
......@@ -184,7 +184,8 @@ static size_t pb_show_prepare_field_context(const ProtobufCFieldDescriptor *fd,
break;
case PROTOBUF_C_TYPE_MESSAGE:
ctl->arg = (void *)fd->descriptor;
field->data = (void *)(*(long *)field->data);
if (field->data)
field->data = (void *)(*(long *)field->data);
case PROTOBUF_C_TYPE_STRING:
fsize = sizeof (void *);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment