mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
Validate the typed data before dereferencing the internal struct. (#8315)
This commit is contained in:
parent
141102b0b0
commit
901b6d9c50
Notes:
git
2023-08-29 08:04:49 +00:00
Merged-By: ioquatix <samuel@codeotaku.com>
2 changed files with 24 additions and 2 deletions
|
@ -34,6 +34,27 @@ class TestFiberProcess < Test::Unit::TestCase
|
|||
end.join
|
||||
end
|
||||
|
||||
def test_system_faulty_process_wait
|
||||
Thread.new do
|
||||
scheduler = Scheduler.new
|
||||
|
||||
def scheduler.process_wait(pid, flags)
|
||||
Fiber.blocking{Process.wait(pid, flags)}
|
||||
|
||||
# Don't return `Process::Status` instance.
|
||||
return false
|
||||
end
|
||||
|
||||
Fiber.set_scheduler scheduler
|
||||
|
||||
Fiber.schedule do
|
||||
assert_raise TypeError do
|
||||
system("true")
|
||||
end
|
||||
end
|
||||
end.join
|
||||
end
|
||||
|
||||
def test_fork
|
||||
omit 'fork not supported' unless Process.respond_to?(:fork)
|
||||
Thread.new do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue