diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-05 05:37:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-05 05:37:58 +0000 |
commit | 3969b1861c344fd37c1c6f59499836c849f098d7 (patch) | |
tree | 9ecf861f4018cd9ce24f4f68ae26f8e019070784 | |
parent | 4b193223847545cbeacfc518805705a56e756c64 (diff) | |
download | ruby-3969b1861c344fd37c1c6f59499836c849f098d7.tar.gz |
transcode.c: fix dangling pointers
* 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/trunk@51488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | transcode.c | 9 |
2 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,9 @@ +Wed Aug 5 14:37:55 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] + Tue Aug 4 16:53:43 2015 Aaron Patterson <tenderlove@ruby-lang.org> * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callback diff --git a/transcode.c b/transcode.c index 5e20fd73a4..25527e1b9f 100644 --- a/transcode.c +++ b/transcode.c @@ -993,6 +993,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; @@ -3246,10 +3247,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; |