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,6 +184,7 @@ static size_t pb_show_prepare_field_context(const ProtobufCFieldDescriptor *fd, ...@@ -184,6 +184,7 @@ static size_t pb_show_prepare_field_context(const ProtobufCFieldDescriptor *fd,
break; break;
case PROTOBUF_C_TYPE_MESSAGE: case PROTOBUF_C_TYPE_MESSAGE:
ctl->arg = (void *)fd->descriptor; ctl->arg = (void *)fd->descriptor;
if (field->data)
field->data = (void *)(*(long *)field->data); field->data = (void *)(*(long *)field->data);
case PROTOBUF_C_TYPE_STRING: case PROTOBUF_C_TYPE_STRING:
fsize = sizeof (void *); fsize = sizeof (void *);
......
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