diff options
author | Kenichi Kamiya <kachick1@gmail.com> | 2021-03-27 14:45:10 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-03-28 14:04:10 +0900 |
commit | 9af57eeed61ad53c0a2a92a93a6a6e40704cd6ae (patch) | |
tree | 4fb3780543ce4d0c4d6a10c754caecd275d132f3 /ext | |
parent | 447e095413557330760558c2b0e1d82c3aa685f1 (diff) |
[ruby/pathname] Fix segfault of Pathname#split
Fix segmentation fault of Pathname#split when File.split returns
non array value [Bug #17755]
https://github.com/ruby/pathname/commit/e29b49e3b1
https://github.com/ruby/pathname/commit/1db7479a74
Diffstat (limited to 'ext')
-rw-r--r-- | ext/pathname/pathname.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index 55577d7da7..1d4ed2814b 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -834,7 +834,7 @@ path_split(VALUE self) VALUE str = get_strpath(self); VALUE ary, dirname, basename; ary = rb_funcall(rb_cFile, id_split, 1, str); - ary = rb_check_array_type(ary); + Check_Type(ary, T_ARRAY); dirname = rb_ary_entry(ary, 0); basename = rb_ary_entry(ary, 1); dirname = rb_class_new_instance(1, &dirname, rb_obj_class(self)); |