Actions
Bug #11387
closedString#force_encoding と String#reverse の後にSEGV
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-07-22 trunk 51342) [x86_64-darwin14]
Description
以下のコードでSEGVします。
broken_str = "abcd\xf0"
broken_str.force_encoding("utf-8").reverse
p broken_str.reverse
また、以下のコードでは String#split
で ArgumentError (invalid byte sequence in UTF-8)
が
発生することが期待されますが、実際は例外が発生しません。
broken_str = "abcd\xf0"
broken_str.force_encoding("utf-8").reverse
"".split(broken_str)
Files
Updated by tatzyr (Tatsuya Otsuka) over 9 years ago
- File stdout-and-stderr.txt stdout-and-stderr.txt added
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Description updated (diff)
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Status changed from Open to Closed
Applied in changeset r51344.
string.c: fix coderange of reverse
- string.c (rb_str_reverse): reversed string is not a substring,
and should not set coderange of the original string.
[ruby-dev:49189] [Bug #11387]
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE
Backported into ruby_2_2
branch at r51520.
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE
ruby_2_1 r51600 merged revision(s) 51344.
Actions
Like0
Like0Like0Like0Like0Like0