summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Oops, forgotten to addruby_2_5usa2021-04-051-0/+77
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* REXML 3.1.7.4usa2021-04-0510-146/+782
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Backport webrick patch for CVE-2020-25613usa2021-02-163-9/+9
| | | | | | | [Backport #17201] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [Backport #17381] repalce the old certs in RubyGemsusa2020-12-097-57/+33
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s): 07786edusa2020-10-282-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | * test/net/http/test_https.rb: Stop the error due to openssl 1.1.1h On some environments that uses OpenSSL 1.1.1h, the two tests now fail. http://rubyci.s3.amazonaws.com/android29-x86_64/ruby-master/log/20200924T062352Z.fail.html.gz https://github.com/ruby/ruby/runs/1159288773?check_suite_focus=true ``` 1) Failure: TestNetHTTPS#test_get [/data/data/com.termux/files/home/cb/tmp/build/202 00924T062352Z/ruby/test/net/http/test_https.rb:47]: <"0\x82\x03\xED0\x82\x02\xD5\xA0\x03..."> expected but was <"0\x82\x03\xE30\x82\x02\xCB\xA0\x03...">. ``` Not sure why, but verify_callback now seems to receive only SERVER_CERT but not CA_CERT. It would be good to investigate the issue furthermore, but tentatively, I want to stop the failures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 7e289cdf3fed588b2d5a6973e29f9ff95cb8d76c: [Backport #16949]usa2020-06-134-29/+26
| | | | | | | | | | | | | | | | [ruby/psych] Fixing compatibility with libyaml 0.2.5 The main issue is that commas aren't allowed in local tags. libyaml was updated to follow the spec, and our tests were out of date. See: https://github.com/yaml/libyaml/issues/196 https://github.com/ruby/psych/commit/3f5e520fd3 Note that this is not security fix, but need for release processs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 47a1872cd8b901b8aab6dedce7fa3807c97d290d: [Backport #16681]usa2020-03-312-4/+4
| | | | | | | | Use osuosl instead of GitHub releases Because the package provided by GitHub releases is different from sourceware. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 61b7f86248bd121be2e83768be71ef289e8e5b90usa2020-03-312-10/+9
| | | | | | | | | | | * ext/socket/init.c: do not return uninitialized buffer Resize string buffer only if some data is received in BasicSocket#read_nonblock and some methods. Co-Authored-By: Samuel Williams <samuel.williams@oriontransfer.co.nz> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 4adb2d655dcd54b28366b4d17e86b21e2b622cd1: [Backport #16738]usa2020-03-303-2/+11
| | | | | | | | | | Make RbConfig::CONFIG values mutable [Bug #16738] As `RbConfig.expand` modifies the argument and involved `CONFIG` values, its values should be mutable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 62743: [Backport #16687]usa2020-03-302-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix FrozenError on `Ripper.slice` Currently `Ripper.slice` raises a FrozenError ```ruby require 'ripper' p Ripper.slice('foo', 'ident') ``` ``` /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `concat': can't modify frozen String (FrozenError) from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `block in compile' from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `scan' from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `compile' from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:169:in `initialize' from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `new' from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `token_match' from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:144:in `slice' from /tmp/tmp.kb4cnhvum2/test.rb:2:in `<main>' ``` This patch will fix the problem. [Fix GH-1837] From: Masataka Pocke Kuwabara <kuwabara@pocke.me> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 8a6ba10f9dd456cf54de800203cf04bbe42271fb: [Backport #12392]usa2020-03-302-5/+9
| | | | | | | Do not make disabled directories at installation [Bug #12392] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 36e9ed7fef6eb2d14becf6c52452e4ab16e4bf01: [Backport #16698]usa2020-03-303-3/+3
| | | | | | | | | backport 80b5a0ff2a7709367178f29d4ebe1c54122b1c27 partially as a securify fix for CVE-2020-10663. The patch was provided by Jeremy Evans. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 6e6844320de989cb88a154e2ac75066ccea1bba2: [Backport #16619]usa2020-03-303-7/+7
| | | | | | | | | | Fixed duplicated warning As `command_rhs` is always a "value expression", `command_asgn` does not need the same check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 6a2d779027818eda418c9118f700b36816e833a5: [Backport #16681]usa2020-03-302-4/+4
| | | | | | | | | | Switch to download libffi source package to github releases from sourceware.org [Bug #16681] (cherry picked from commit 86022167461dc90b70164e2bb23316959bbfd6ba) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 77596fb7a91cc119b25ac9e19b3c8682709765b4: [Backport #16138]usa2020-03-303-8/+10
| | | | | | | | | | | | | Do not turn on keyword_init for Struct subclass if keyword hash is empty This was accidentally turned on because there was no checking for Qundef. Also, since only a single keyword is currently supported, simplify the rb_get_kwargs call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 4f19666e8b144600e959e4673f79d63f98bd637d: [Backport #16508]usa2020-03-303-1/+6
| | | | | | | | | | | `Regexp` in `MatchData` can be `nil` `String#sub` with a string pattern defers creating a `Regexp` until `MatchData#regexp` creates a `Regexp` from the matched string. `Regexp#last_match(group_name)` accessed its content without creating the `Regexp` though. [Bug #16508] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2020-03-303-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d6a2bce64a7fa1099e507e1d36b5f1533f42f60f,c687be4bc01c9ce52ea990945d9304d6fe59fe9b: [Backport #16159] time.c (find_time_t): fix round-to-zero bug `find_time_t` did not work correctly for year older than the Epoch because it used C's integer division (which rounds negative to zero). For example, `TIme.new(1933)` returned a wrong time whose year is 1922 in Asia/Kuala_Lumpur because there is no 00:00:00 1st Jan. 1933 in the time zone. ``` $ TZ=Asia/Kuala_Lumpur ruby -e 'p Time.new(1933)' 1932-12-31 00:00:00 +0700 ``` This change fixes the issue by using `DIV` macro instead of `/`. Now `Time.new(1933)` returns a time in 1933. ``` $ TZ=Asia/Kuala_Lumpur ruby -e 'p Time.new(1933)' 1933-01-01 00:20:00 +0720 ``` [Bug #16159] Added a test for [Bug #16159] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2020-03-303-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 203b7fa1ae8cc40d41c38d684f70b3fea7fae813,0131fab749fb76800de09e49a6abf910201c5b58,9c0cd5c569ba22bc68d1a77ad6580a275cd99639,c144d7215b3444fa36d28d540b60170a5b30743d: [Backport #16196] Guard static variable first * ext/openssl/ossl_asn1.c (Init_ossl_asn1): register the static variable to grab an internal object, before creating the object. otherwise the just-created object could get collected during the global variable list allocation. [Bug #16196] Slimed down test runtime by stressing openssl.so only [Bug #16196] Prefer rb_gc_register_mark_object * ext/openssl/ossl_asn1.c (Init_ossl_asn1): prefer `rb_gc_register_mark_object`, which is better for constant objects, over `rb_gc_register_address` for global/static variables which can be re-assigned at runtime. [Bug #16196] Skip very time consuming test [Bug #16196] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 463092b84da7933f307cc8747f948f68ef19f5fd: [Backport #16279]usa2020-03-302-2/+2
| | | | | | | Update rake-12.3.3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2020-03-303-6/+56
| | | | | | | | | | | | | | | | | | | c9423b016cfeab852bc5a829e55e0a11f80b3ab7,0b1e26398e018116180bf41cb63887f77d5d1b82,78ee2c245331e353e218b8fac9ca722a2bcd8fea: [Backport #15968] marshal.c: check instance variable count * marshal.c (w_obj_each): ensure that no instance variable was added while dumping other instance variables. [Bug #15968] Hoisted out w_ivar_each marshal.c: check instance variable count * marshal.c (w_ivar_each): ensure that no instance variable was removed while dumping other instance variables. [Bug #15968] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 78ef2d0f331c3e056ee367214710b41722de2fe0: [Backport #15935]usa2020-03-302-6/+9
| | | | | | | | | | | | | | | | merge revision(s) 8b3774be3dd9f472bddd99e84e3c9fe2ff99d7ac: [Backport #15935] Fix memory leak * string.c (str_make_independent_expand): free independent buffer. [Bug# 15935] Co-Authored-By: luke-gru (Luke Gruber) <luke.gru@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 2a477e0e444de6344048101466fb9189b9defddc: [Backport #16353]usa2019-12-042-8/+8
| | | | | | | | | | test_ftp.rb: loosen timeout for Travis osx https://travis-ci.org/ruby/ruby/jobs/454798071 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 6333020fc924d3ae63775c032bbe8f57364cd42e:usa2019-11-082-4/+7
| | | | | | | | | | | | | | | | | atime may not updated unless strictatime is set on macOS Catalina Cited from mount(8): ``` strictatime Always update the file access time when reading from a file. Without this option the filesystem may default to a less strict update mode, where some access time updates are skipped for performance reasons. This option could be ignored if it is not supported by the filesystem. ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Bump versionusa2019-10-031-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Forgotten to update :)usa2019-10-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/shell/command-processor.rb (Shell#[]): prevent unknown commandusa2019-10-012-0/+21
| | | | | | | | | `FileTest.send(command, ...)` allows to call not only FileTest-related methods but also any method that belongs to Kernel, Object, etc. patched by <mame@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 3ce238b5f9795581eb84114dcfbdf4aa086bfeccusa2019-10-013-4/+47
| | | | | | | | | | | | | WEBrick: prevent response splitting and header injection This is a follow up to d9d4a28. The commit prevented CRLR, but did not address an isolated CR or an isolated LF. Co-Authored-By: NARUSE, Yui <naruse@airemix.jp> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 36e057e26ef2104bc2349799d6c52d22bb1c7d03usa2019-10-013-18/+25
| | | | | | | | | | Loop with String#scan without creating substrings Create the substrings necessary parts only, instead of cutting the rest of the buffer. Also removed a useless, probable typo, regexp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) a0a2640b398cffd351f87d3f6243103add66575busa2019-10-013-5/+11
| | | | | | | | | | Fix for wrong fnmatch patttern * dir.c (file_s_fnmatch): ensure that pattern does not contain a NUL character. https://hackerone.com/reports/449617 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Bump version to 2.5.7usa2019-09-011-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merger revision(s): f308ab2131ee675000926540cbb8c13c91dc3be5usa2019-08-282-5/+1
| | | | | | | Remove jquery.js git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 989e8ad322afdfa3aa06e74b89fc42aef42895d0:usa2019-08-282-3/+2
| | | | | | | Remove debug print [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Bump version to 2.5.7usa2019-08-271-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update rdoc version from 6.0.1 to 6.0.1.1.usa2019-08-278-181/+94
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Skip test_gc_stress_at_startup because it causes SEGV on some platformsusa2019-08-272-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 1613917ae64: [Backport #15784]usa2019-08-272-8/+2
| | | | | | | | Defer setting gc_stress instead of setting dont_gc [Bug #15784] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert a part of r67767usa2019-08-272-8/+1
| | | | | | | it was not necessary for ruby_2_5. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) f1a52d96a59c63d46cb23af60cdcaf38e30e0512 [Backport #15784]usa2019-08-273-1/+14
| | | | | | | | | Defer setting gc_stress until inits done [Bug #15784] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2019-08-262-10/+19
| | | | | | | | | | | | | | | | f91879a7b548284c93743168acfd11e3d2aeefac,9557069299ac3b96691040a541afa65761a724ad: [Backport #15992] handle_interrupt to defend monitor state [Bug #15992] If an exception is raised from another thread for example Timeout and this thread is just after `mon_exit`'s `@mon_owner = nil`, the exception breaks the state of MonitorMixin. To prevent that situation, it need to block interruption in mon_enter and mon_exit. Avoid creating Hash objects per each mon_synchronize call (#2393) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) d5c33364e3c0efb15e11df417c925afee2cdb9c9: [Backport #16105]usa2019-08-263-2/+9
| | | | | | | | | | | Fixed heap-use-after-free * string.c (rb_str_sub_bang): retrieves a pointer to the replacement string buffer just before using it, for the case of replacement with the receiver string itself. [Bug #16105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 5b1bf8dd2d08ae7371ecf025967376bb794ed651: [Backport #16099]usa2019-08-264-12/+9
| | | | | | | | | | UTF LE is fixed at least the first 2 bytes * io.c (io_strip_bom): if the first 2 bytes are 0xFF0xFE, it should be a little-endian UTF, 16 or 32. [Bug #16099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2019-08-263-2/+14
| | | | | | | | | | | | | | | | | | ec8e5f5aa64e2a54cf1e303f2b012c98e8d521ba,5a187e26adc8aa32367f294c1496935c7356d386: [Backport #15952] array.c: always check frozenness in Array#unshift. Fixes [Bug #15952] Closes: https://github.com/ruby/ruby/pull/2251 array.c add back shared array optimization to ary_ensure_room_for_unshift Bug fix in commit ec8e5f5aa64e2a [Bug #15952] disabled an optimization in this function. Closes: https://github.com/ruby/ruby/pull/2252 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 8f51da5d41f0642d5a971e4223d1ba14643c6398: [Backport #15946]usa2019-08-262-2/+2
| | | | | | | | | Get rid of undefined behavior * string.c (rb_str_sub_bang): str and repl can be same. [Bug #15946] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2019-08-263-2/+28
| | | | | | | | | | | | | | | | | 28678997e40869f5591eae60edd9757334426ffb,8797f48373dcfa3ff8e748667732dea8aea4347e: [Backport #15937] Preserve the string content at self-copying * string.c (rb_str_init): preserve the embedded content when self-copying with a capacity. [Bug #15937] New buffer for shared string * string.c (rb_str_init): allocate new buffer if the string is shared. [Bug #15937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2019-08-266-142/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | ae2a904ce9bffedee7d110dc60fd51c0a2879a5b,165ddfda20f6db8a3149d14c4f431fc242ddab70,fa7a768fdfe5223a29db4fa71b3e6101fb02ad51: [Backport #16051] Update the certificate files to make the test pass on Debian 10 The old certificate files (for example, test/rubygems/ca_cert.pem) were signed by SHA1. This message digest is considered too weak and rejected by OpenSSL 1.1.1 or later. Because of this, the test suite does not pass on Debian 10. https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190527T123003Z.fail.html.gz#test%2Frubygems This change regenerates the files. A shell script for the regeneration (util/create_certs.sh) is also added. * remove trailing spaces. Removed inconsistency file from upstream repository of rubygems. followed up ae2a904ce9bffedee7d110dc60fd51c0a2879a5b git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 9dec4e8fc3a6018261834b5ac9b9877f787b97ca: [Backport #15934]usa2019-08-263-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | String#b: Don't depend on dependent string Registering a string that depend on a dependent string as fstring can lead to use-after-free. See c06ddfe and 3f95620 for details. The following script triggers use-after-free on trunk, 2.4.6, 2.5.5 and 2.6.3. Credits to @wanabe for using eval as a cross-version way of registering a fstring. ```ruby a = ('j' * 24).b.b eval('', binding, a) p a 4.times { GC.start } p a ``` - string.c (str_replace_shared_without_enc): when given a dependent string, depend on the root of the dependent string. [Bug #15934] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2019-08-266-5/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3f9562015e651735bfc2fdd14e8f6963b673e22a,c06ddfee878524168e4af07443217ed2f8d0954b,3b3b4a44e5: [Backport #15792] Get rid of indirect sharing * string.c (str_duplicate): share the root shared string if the original string is already sharing, so that all shared strings refer the root shared string directly. indirect sharing can cause a dangling pointer. [Bug #15792] str_duplicate: Don't share with a frozen shared string This is a follow up for 3f9562015e651735bfc2fdd14e8f6963b673e22a. Before this commit, it was possible to create a shared string which shares with another shared string by passing a frozen shared string to `str_duplicate`. Such string looks like: ``` -------- ----------------- | root | ------ owns -----> | root's buffer | -------- ----------------- ^ ^ ^ ----------- | | | shared1 | ------ references ----- | ----------- | ^ | ----------- | | shared2 | ------ references --------- ----------- ``` This is bad news because `rb_fstring(shared2)` can make `shared1` independent, which severs the reference from `shared1` to `root`: ```c /* from fstr_update_callback() */ str = str_new_frozen(rb_cString, shared2); /* can return shared1 */ if (STR_SHARED_P(str)) { /* shared1 is also a shared string */ str_make_independent(str); /* no frozen check */ } ``` If `shared1` was the only reference to `root`, then `root` can be reclaimed by the GC, leaving `shared2` in a corrupted state: ``` ----------- -------------------- | shared1 | -------- owns --------> | shared1's buffer | ----------- -------------------- ^ | ----------- ------------------------- | shared2 | ------ references ----> | root's buffer (freed) | ----------- ------------------------- ``` Here is a reproduction script for the situation this commit fixes. ```ruby a = ('a' * 24).strip.freeze.strip -a p a 4.times { GC.start } p a ``` - string.c (str_duplicate): always share with the root string when the original is a shared string. - test_rb_str_dup.rb: specifically test `rb_str_dup` to make sure it does not try to share with a shared string. [Bug #15792] Closes: https://github.com/ruby/ruby/pull/2159 Update dependencies git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) 5e018214e7435030727a97ac49db038d96438e74: [Backport #15720]usa2019-08-263-2/+37
| | | | | | | | Fix SystemStackError when calling a method in an unused refinement Fixes [Bug #15720] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) c1d78a7f0ece2004822193a0c1f1fd3dc38c2fdf: [Backport #15360]usa2019-08-262-2/+6
| | | | | | | | do_mutex_lock: release mutex before checking for interrupts (fixes issue 15360) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge revision(s) ↵usa2019-08-263-39/+77
| | | | | | | | | | | | | | | | | | 6375c68f8851e1e0fee8a95afba91c4555097127,c05eaa93258ddc01e685b6cc3a0da82998a2af48: [Backport #15839] parse.y: function parser_mixed_error & parser_mixed_escape Fix mixed encoding in heredoc Heredocs are parsed line-by-line, so we need to keep track of the temporary encoding of the string. Previously, a heredoc would only detect mixed encoding errors if they were on the same line, this changes things so they will be caught on different lines. Fixes [Bug #15839] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e