[前][次][番号順一覧][スレッド一覧]

ruby-changes:28103

From: nobu <ko1@a...>
Date: Sat, 6 Apr 2013 16:58:57 +0900 (JST)
Subject: [ruby-changes:28103] nobu:r40155 (trunk): socket.c: suppress warnings

nobu	2013-04-06 16:58:47 +0900 (Sat, 06 Apr 2013)

  New Revision: 40155

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40155

  Log:
    socket.c: suppress warnings
    
    * ext/socket/socket.c (rsock_sys_fail_sockaddr): cast down explicitly
      to suppress warnings.

  Modified files:
    trunk/ext/socket/socket.c

Index: ext/socket/socket.c
===================================================================
--- ext/socket/socket.c	(revision 40154)
+++ ext/socket/socket.c	(revision 40155)
@@ -53,7 +53,7 @@ rsock_sys_fail_sockaddr(const char *mesg https://github.com/ruby/ruby/blob/trunk/ext/socket/socket.c#L53
 
     rai = rsock_addrinfo_new(
             (struct sockaddr *)RSTRING_PTR(addr),
-            RSTRING_LEN(addr),
+            (socklen_t)RSTRING_LEN(addr), /* overflow should be checked already */
             PF_UNSPEC, 0, 0, Qnil, Qnil);
 
     rsock_sys_fail_addrinfo(mesg, rai);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]