diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-30 14:11:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-30 14:11:56 +0000 |
commit | 347da440cfefc7eec1d182110f4b42ac8e9af27b (patch) | |
tree | 3715717e1516f08d222326233db069e45c3cfdb7 /dir.c | |
parent | 24a72a177d3006482abe0bfe7d531d6575361679 (diff) | |
download | bundler-347da440cfefc7eec1d182110f4b42ac8e9af27b.tar.gz |
ensure paths NUL-terminated
* dir.c (check_dirname): ensure path name NUL-terminated for
SHARABLE_MIDDLE_SUBSTRING.
* io.c (rb_sysopen): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1019,6 +1019,7 @@ check_dirname(VALUE dir) pend = rb_enc_path_end(rb_enc_path_skip_prefix(path, pend, enc), pend, enc); if (pend - path < len) { d = rb_str_subseq(d, 0, pend - path); + StringValueCStr(d); } return rb_str_encode_ospath(d); } |