diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-10 21:55:51 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-10 21:55:51 +0000 |
commit | c8c539a19813a0ff44e05f9639a56d686876d4e1 (patch) | |
tree | 3372dd215133e9367797d9ec9ad6f1ef46bf841b /ext/objspace | |
parent | d8182739c79e6b34f48dcae446fa135a2d056ba6 (diff) | |
download | ruby-c8c539a19813a0ff44e05f9639a56d686876d4e1.tar.gz |
ext/objspace: Check fptr before trying to dump FILE object fd
Patch by Scott Francis. Closes GH-562.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace')
-rw-r--r-- | ext/objspace/objspace_dump.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c index 6b3bf44489..076d4fbaa1 100644 --- a/ext/objspace/objspace_dump.c +++ b/ext/objspace/objspace_dump.c @@ -230,7 +230,8 @@ dump_object(VALUE obj, struct dump_config *dc) case T_FILE: fptr = RFILE(obj)->fptr; - dump_append(dc, ", \"fd\":%d", fptr->fd); + if (fptr) + dump_append(dc, ", \"fd\":%d", fptr->fd); break; case T_ZOMBIE: |