[pull] master from ruby:master - #1431
Merged
Merged
Conversation
Once all `*.rbinc` files have been generated, the command should not be required anymore.
String#tr can crash if keys are removed from the translation hash since
we stack allocate a buffer pairs. If entries are deleted during runtime,
then we won't fill the pairs buffer which can crash because it will be
reading uninitialized values out of pairs.
The following script demonstrates the crash:
h = {}
obj = Object.new
obj.define_singleton_method(:to_str) do
h.clear
"a"
end
h[obj] = "x"
("b".."z").each { |c| h[c] = (c.ord + 1).chr }
puts "ab".tr!(h)
fu_copy_stream0 has had no caller since b26846bf replaced both uses with direct IO.copy_stream calls in 2008. The retained private wrapper is unreachable. ruby/fileutils@feba38f651
…able In user-namespace environments (e.g. ChromeOS Crostini) getgroups(2) can report supplementary groups such as the overflow GID 65534 (nobody) that a non-root process cannot actually chgrp a file to. TestFileUtils#setup built @groups straight from `[Process.gid] | Process.groups`, so the chown tests tried to chgrp to such a group and failed with EPERM instead of being skipped. Filter @groups with a one-time capability probe down to the groups the process can actually assign, so the affected tests skip via their existing `return unless @groups[1]` guard when there is no usable second group. ruby/fileutils@8dc0266054 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Skip the test_rm_r_no_permissions test under the root user, as deletion always succeeds. Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com> ruby/fileutils@3c831389c5
Since `Process.uid` returns `0` always on mingw or mswin, `root_in_posix?` returns `true` too. ruby/fileutils@d18fbf0c56
If the source string is modified when converting offset to an integer,
then there could be an out-of-bounds access because the length of the
string is captured before to_int is called. For example, the following
script triggers an ASAN error:
s = "héllo" * 1_000_000
obj = Object.new
obj.define_singleton_method(:to_int) do
s.replace("é" * 1000)
450000
end
p s.byteindex("l", obj)
When the array is shrunk during rb_arithmetic_sequence_beg_len_step, ary_subseq_len returns -1. Return an empty array instead of passing the negative length to ary_make_partial or ary_make_partial_step. [Bug #22325]
We need to keep track of pending pages in RubyHeapTrigger otherwise a large allocation may cause infinite number of GCs to be ran since it will always appear that we have enough space in the heap (and thus the heap won't grow) but still not have enough for the allocation. ruby/mmtk@dd8034050d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )