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

ruby-changes:28574

From: akr <ko1@a...>
Date: Thu, 9 May 2013 22:01:27 +0900 (JST)
Subject: [ruby-changes:28574] akr:r40626 (trunk): * ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should

akr	2013-05-09 22:01:08 +0900 (Thu, 09 May 2013)

  New Revision: 40626

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

  Log:
    * ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should
      not be negative.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40625)
+++ ChangeLog	(revision 40626)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu May  9 22:00:35 2013  Tanaka Akira  <akr@f...>
+
+	* ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should
+	  not be negative.
+
 Thu May  9 21:09:57 2013  Tanaka Akira  <akr@f...>
 
 	* file.c, ext/etc/etc.c, ext/socket/unixsocket.c,
Index: ext/socket/ancdata.c
===================================================================
--- ext/socket/ancdata.c	(revision 40625)
+++ ext/socket/ancdata.c	(revision 40626)
@@ -1153,7 +1153,7 @@ bsock_sendmsg_internal(int argc, VALUE * https://github.com/ruby/ruby/blob/trunk/ext/socket/ancdata.c#L1153
     data = argv[0];
     if (1 < argc) vflags = argv[1];
     if (2 < argc) dest_sockaddr = argv[2];
-    controls_num = argc - 3;
+    controls_num = 3 < argc ? argc - 3 : 0;
 #if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
     if (3 < argc) { controls_ptr = &argv[3]; }
 #endif

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

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