2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

pb: Don't crash when showing empty repeated field

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2014-02-04 11:52:55 +04:00
parent 54f4f889a5
commit 8f7bae2cfc

View File

@@ -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;