ANDROID: fuse-bpf: fix fuse_create_open_finalize

If we hit an error during fuse_create_open, some variables will be
undefined during the finalize, so check that they were actually
initialized before accessing.

Bug: 217570523
Test: attempt to over fill disk
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Change-Id: I094564b83e49eec2a6bac5bd050b4f7327b0c979
This commit is contained in:
Daniel Rosenberg
2022-02-07 18:02:17 -08:00
parent 8fa8dfc519
commit c4ac8b4248

View File

@@ -339,8 +339,10 @@ void *fuse_create_open_finalize(
struct fuse_entry_out *feo = fa->out_args[0].value;
struct fuse_open_out *foo = fa->out_args[1].value;
fi->nodeid = feo->nodeid;
ff->fh = foo->fh;
if (fi)
fi->nodeid = feo->nodeid;
if (ff)
ff->fh = foo->fh;
return 0;
}