mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 51488,51489: [Backport #11416]
* transcode.c (rb_econv_open0): rb_econv_t::source_encoding_name and rb_econv_t::destination_encoding_name should refer static strings always or NULL. [ruby-core:70247] [Bug #11416] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@52798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cb826f3ff9
commit
1237e7a50b
3 changed files with 18 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Nov 30 21:09:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* transcode.c (rb_econv_open0): rb_econv_t::source_encoding_name
|
||||
and rb_econv_t::destination_encoding_name should refer static
|
||||
strings always or NULL. [ruby-core:70247] [Bug #11416]
|
||||
|
||||
Mon Nov 30 21:02:21 2015 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid
|
||||
|
|
16
transcode.c
16
transcode.c
|
@ -995,6 +995,7 @@ rb_econv_open0(const char *sname, const char *dname, int ecflags)
|
|||
if (*sname == '\0' && *dname == '\0') {
|
||||
num_trans = 0;
|
||||
entries = NULL;
|
||||
sname = dname = "";
|
||||
}
|
||||
else {
|
||||
struct trans_open_t toarg;
|
||||
|
@ -3248,10 +3249,10 @@ rb_econv_init_by_convpath(VALUE self, VALUE convpath,
|
|||
}
|
||||
|
||||
if (first) {
|
||||
*senc_p = NULL;
|
||||
*denc_p = NULL;
|
||||
*sname_p = "";
|
||||
*dname_p = "";
|
||||
*senc_p = NULL;
|
||||
*denc_p = NULL;
|
||||
*sname_p = "";
|
||||
*dname_p = "";
|
||||
}
|
||||
|
||||
ec->source_encoding_name = *sname_p;
|
||||
|
@ -3392,7 +3393,10 @@ econv_init(int argc, VALUE *argv, VALUE self)
|
|||
}
|
||||
|
||||
if (!ec) {
|
||||
rb_exc_raise(rb_econv_open_exc(sname, dname, ecflags));
|
||||
VALUE exc = rb_econv_open_exc(sname, dname, ecflags);
|
||||
RB_GC_GUARD(snamev);
|
||||
RB_GC_GUARD(dnamev);
|
||||
rb_exc_raise(exc);
|
||||
}
|
||||
|
||||
if (!DECORATOR_P(sname, dname)) {
|
||||
|
@ -3400,6 +3404,8 @@ econv_init(int argc, VALUE *argv, VALUE self)
|
|||
senc = make_dummy_encoding(sname);
|
||||
if (!denc)
|
||||
denc = make_dummy_encoding(dname);
|
||||
RB_GC_GUARD(snamev);
|
||||
RB_GC_GUARD(dnamev);
|
||||
}
|
||||
|
||||
ec->source_encoding = senc;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.1.8"
|
||||
#define RUBY_RELEASE_DATE "2015-11-30"
|
||||
#define RUBY_PATCHLEVEL 423
|
||||
#define RUBY_PATCHLEVEL 424
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2015
|
||||
#define RUBY_RELEASE_MONTH 11
|
||||
|
|
Loading…
Add table
Reference in a new issue