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
This commit is contained in:
parent
24a72a177d
commit
347da440cf
@ -1,3 +1,10 @@
|
||||
Tue Jun 30 23:11:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* dir.c (check_dirname): ensure path name NUL-terminated for
|
||||
SHARABLE_MIDDLE_SUBSTRING.
|
||||
|
||||
* io.c (rb_sysopen): ditto.
|
||||
|
||||
Tue Jun 30 18:38:16 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/file.c (rb_freopen): need to terminate by NUL.
|
||||
|
1
dir.c
1
dir.c
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user