summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-18 23:29:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-18 23:29:24 +0000
commit1635979ed88dae20542db13b637f68942e99ed3b (patch)
tree9c825acc6b447da626e9e3637abfffef820b817b /file.c
parent4b851d5a9122f6ef9bfcd525e4538cd641857062 (diff)
downloadruby-1635979ed88dae20542db13b637f68942e99ed3b.tar.gz
ruby-1635979ed88dae20542db13b637f68942e99ed3b.tar.xz
ruby-1635979ed88dae20542db13b637f68942e99ed3b.zip
* file.c (rb_file_join): elements may contain null pointer strings.
report and fixed by Lloyd Zusman (hippoman): [ruby-core:06326] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index d7a8d07cc..f9e6f752f 100644
--- a/file.c
+++ b/file.c
@@ -2745,7 +2745,7 @@ rb_file_join(VALUE ary, VALUE sep)
name = StringValueCStr(result);
if (i > 0 && !NIL_P(sep)) {
tail = chompdirsep(name);
- if (isdirsep(RSTRING(tmp)->ptr[0])) {
+ if (RSTRING(tmp)->ptr && isdirsep(RSTRING(tmp)->ptr[0])) {
RSTRING(result)->len = tail - name;
}
else if (!*tail) {