diff options
author | 2022-11-07 00:50:32 -0800 | |
---|---|---|
committer | 2022-11-07 00:50:32 -0800 | |
commit | 072cd5a7457c44f37786df4d6dc57e4c5caa1bae (patch) | |
tree | b99058842b0f56bbd502f465e1e3623b8d0a1e56 /src/bun.js/node/node_fs.zig | |
parent | c52d9fd1b69ae5ec123b6eb0311e45e36e7e6c3c (diff) | |
download | bun-072cd5a7457c44f37786df4d6dc57e4c5caa1bae.tar.gz bun-072cd5a7457c44f37786df4d6dc57e4c5caa1bae.tar.zst bun-072cd5a7457c44f37786df4d6dc57e4c5caa1bae.zip |
Fix UAF in canary
Diffstat (limited to 'src/bun.js/node/node_fs.zig')
-rw-r--r-- | src/bun.js/node/node_fs.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bun.js/node/node_fs.zig b/src/bun.js/node/node_fs.zig index 6862b53de..23596d7b5 100644 --- a/src/bun.js/node/node_fs.zig +++ b/src/bun.js/node/node_fs.zig @@ -101,7 +101,7 @@ const Arguments = struct { len: JSC.WebCore.Blob.SizeType = 0, pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?Truncate { - const path = PathOrFileDescriptor.fromJS(ctx, arguments, exception) orelse { + const path = PathOrFileDescriptor.fromJS(ctx, arguments, arguments.arena.allocator(), exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "path must be a string or TypedArray", @@ -1448,7 +1448,7 @@ const Arguments = struct { flag: FileSystemFlags = FileSystemFlags.@"r", pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?ReadFile { - const path = PathOrFileDescriptor.fromJS(ctx, arguments, exception) orelse { + const path = PathOrFileDescriptor.fromJS(ctx, arguments, arguments.arena.allocator(), exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "path must be a string or a file descriptor", @@ -1529,7 +1529,7 @@ const Arguments = struct { data: StringOrBuffer, pub fn fromJS(ctx: JSC.C.JSContextRef, arguments: *ArgumentsSlice, exception: JSC.C.ExceptionRef) ?WriteFile { - const file = PathOrFileDescriptor.fromJS(ctx, arguments, exception) orelse { + const file = PathOrFileDescriptor.fromJS(ctx, arguments, arguments.arena.allocator(), exception) orelse { if (exception.* == null) { JSC.throwInvalidArguments( "path must be a string or a file descriptor", |