[macruby-changes] [2471] MacRuby/trunk/ext/socket/socket.c

source_changes at macosforge.org source_changes at macosforge.org
Fri Sep 4 14:07:44 PDT 2009


Revision: 2471
          http://trac.macosforge.org/projects/ruby/changeset/2471
Author:   lsansonetti at apple.com
Date:     2009-09-04 14:07:43 -0700 (Fri, 04 Sep 2009)
Log Message:
-----------
don't crash if fptr->path is 0

Modified Paths:
--------------
    MacRuby/trunk/ext/socket/socket.c

Modified: MacRuby/trunk/ext/socket/socket.c
===================================================================
--- MacRuby/trunk/ext/socket/socket.c	2009-09-04 19:27:22 UTC (rev 2470)
+++ MacRuby/trunk/ext/socket/socket.c	2009-09-04 21:07:43 UTC (rev 2471)
@@ -404,7 +404,7 @@
 
     GetOpenFile(sock, fptr);
     if (setsockopt(fptr->fd, level, option, v, vlen) < 0)
-	rb_sys_fail(RSTRING_PTR(fptr->path));
+	rb_sys_fail(fptr->path == 0 ? NULL : RSTRING_PTR(fptr->path));
 
     return INT2FIX(0);
 }
@@ -465,7 +465,7 @@
 
     GetOpenFile(sock, fptr);
     if (getsockopt(fptr->fd, level, option, buf, &len) < 0)
-	rb_sys_fail(RSTRING_PTR(fptr->path));
+	rb_sys_fail(fptr->path == 0 ? NULL : RSTRING_PTR(fptr->path));
 
     return rb_str_new(buf, len);
 #else
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090904/c3611e8b/attachment.html>


More information about the macruby-changes mailing list