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
This commit is contained in:
parent
4b19322384
commit
3969b1861c
@ -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>
|
Tue Aug 4 16:53:43 2015 Aaron Patterson <tenderlove@ruby-lang.org>
|
||||||
|
|
||||||
* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callback
|
* 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') {
|
if (*sname == '\0' && *dname == '\0') {
|
||||||
num_trans = 0;
|
num_trans = 0;
|
||||||
entries = NULL;
|
entries = NULL;
|
||||||
|
sname = dname = "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
struct trans_open_t toarg;
|
struct trans_open_t toarg;
|
||||||
@ -3246,10 +3247,10 @@ rb_econv_init_by_convpath(VALUE self, VALUE convpath,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
*senc_p = NULL;
|
*senc_p = NULL;
|
||||||
*denc_p = NULL;
|
*denc_p = NULL;
|
||||||
*sname_p = "";
|
*sname_p = "";
|
||||||
*dname_p = "";
|
*dname_p = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
ec->source_encoding_name = *sname_p;
|
ec->source_encoding_name = *sname_p;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user