Actions
Bug #13042
closedgsub segfaults when the pattern is a matching string and the replacement has an unmatched named capture
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
Backport:
Description
Ruby segfaults for all code of the form
string.gsub(pattern, replacement)
where pattern
is a substring of string
(not a regex) and replacement
includes a "named capture", such as \k<>
. For example:
'hello'.gsub('hello', '\k<oops>')
Files
Updated by nobu (Nobuyoshi Nakada) about 8 years ago
- Status changed from Open to Closed
Applied in changeset r57098.
re.c: non-regexp name reference
- re.c (rb_reg_regsub): other than regexp has no name references.
[ruby-core:78686] [Bug #13042]
Updated by nagachika (Tomoyuki Chikanaga) about 8 years ago
- Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED
Updated by usa (Usaku NAKAMURA) about 8 years ago
- Backport changed from 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: UNKNOWN, 2.2: DONE, 2.3: REQUIRED
ruby_2_2 r57218 merged revision(s) 57098.
Updated by nagachika (Tomoyuki Chikanaga) about 8 years ago
- Backport changed from 2.1: UNKNOWN, 2.2: DONE, 2.3: REQUIRED to 2.1: UNKNOWN, 2.2: DONE, 2.3: DONE
ruby_2_3 r57349 merged revision(s) 57098.
Actions
Like0
Like0Like0Like0Like0