fix uaf on shell IOReader

This commit is contained in:
Zack Radisic
2024-03-06 12:25:12 -08:00
parent 819b9b4994
commit fe8b034284

View File

@@ -8719,7 +8719,8 @@ pub const Interpreter = struct {
}
pub fn __deinit(this: *@This()) void {
if (this.fd != bun.invalid_fd) {
// windows reader closes the file descriptor
if (this.fd != bun.invalid_fd and !bun.Environment.isWindows) {
log("IOReader(0x{x}) __deinit fd={}", .{ @intFromPtr(this), this.fd });
_ = bun.sys.close(this.fd);
}