summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-05 05:37:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-05 05:37:58 +0000
commit3969b1861c344fd37c1c6f59499836c849f098d7 ()
tree9ecf861f4018cd9ce24f4f68ae26f8e019070784
parent4b193223847545cbeacfc518805705a56e756c64 (diff)
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--ChangeLog6
-rw-r--r--transcode.c9
2 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,9 @@
Tue Aug 4 16:53:43 2015 Aaron Patterson <[email protected]>
* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callback
@@ -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;
}
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 = "";
}
ec->source_encoding_name = *sname_p;