Actions
Bug #14150
closedruby 2.5.0dev SEGV by rb_external_str_new_with_enc(NULL, 0, rb_usascii_encoding())
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-12-02 trunk 60975) [x86_64-linux]
Backport:
Description
rb_external_str_new_with_enc(NULL, 0, rb_usascii_encoding())
gets segmentation fault in ruby 2.5.0-preview1 and ruby 2.5.0dev.
It returns an empty string in released versions.
I made test code which calls following functions.
- rb_str_new(NULL, 0);
- rb_external_str_new(NULL, 0);
- rb_locale_str_new(NULL, 0);
- rb_usascii_str_new(NULL, 0);
- rb_utf8_str_new(NULL, 0);
- rb_enc_str_new(NULL, 0, rb_usascii_encoding());
- rb_external_str_new_with_enc(NULL, 0, rb_usascii_encoding());
The first 6 worked fine but the last only failed.
Files
Updated by nobu (Nobuyoshi Nakada) over 6 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r60979.
string.c: fix rb_external_str_new_with_enc
- string.c (rb_external_str_new_with_enc): do not search non-ascii
by NULL pointer. [ruby-core:84055] [Bug #14150]
Actions
Like0
Like0