diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-09 13:01:08 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-09 13:01:08 +0000 |
commit | 2ffbe0345dd606cffcc30cbfce437762f5fcb496 (patch) | |
tree | a7659cb44e9517b08c8eb367e6781fbcfa9d9d1c | |
parent | bfb334eefa6fdebcf95af0b44f27117b754d93c7 (diff) | |
download | ruby-2ffbe0345dd606cffcc30cbfce437762f5fcb496.tar.gz |
* ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should
not be negative.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/socket/ancdata.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Thu May 9 22:00:35 2013 Tanaka Akira <akr@fsij.org> + + * ext/socket/ancdata.c (bsock_sendmsg_internal): controls_num should + not be negative. + Thu May 9 21:09:57 2013 Tanaka Akira <akr@fsij.org> * file.c, ext/etc/etc.c, ext/socket/unixsocket.c, diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index db5e7fd657..3e6431ebbf 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -1153,7 +1153,7 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock) 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 |