Skip to content

Commit 31bbc1f

Browse files
authored
Merge pull request #4754 from thaJeztah/1.4_restore_nil_pointer
[release/1.4 backport] bug fix:#3448: invalid use of nil pointer in container restoring
2 parents 7fe3f13 + 56291a2 commit 31bbc1f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

container_restore_opts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,21 @@ func WithRestoreRuntime(ctx context.Context, id string, client *Client, checkpoi
8787
return err
8888
}
8989
}
90-
var options *ptypes.Any
90+
var options ptypes.Any
9191
if m != nil {
9292
store := client.ContentStore()
9393
data, err := content.ReadBlob(ctx, store, *m)
9494
if err != nil {
9595
return errors.Wrap(err, "unable to read checkpoint runtime")
9696
}
97-
if err := proto.Unmarshal(data, options); err != nil {
97+
if err := proto.Unmarshal(data, &options); err != nil {
9898
return err
9999
}
100100
}
101101

102102
c.Runtime = containers.RuntimeInfo{
103103
Name: name,
104-
Options: options,
104+
Options: &options,
105105
}
106106
return nil
107107
}

0 commit comments

Comments
 (0)