summaryrefslogtreecommitdiff
path: root/ext/socket/ancdata.c
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-05 16:11:47 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-05 16:11:47 +0000
commit607abcc7be089d7eaf30ad3a702aaaebba20c108 (patch)
tree106543a9b3e83f35b1288e30b47e11b1bc061b10 /ext/socket/ancdata.c
parenteb774ceb222ff36f391313ff6fcebd3d9bcdcc02 (diff)
* ext/socket/ancdata.c (bsock_sendmsg_internal): all arguments are
parsed even on systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL to prevent SEGV caused by passing Qnil to RARRAY_LENINT and to preserve behavior before r50776. [Bug #11224] [ruby-core:69468] [Bug #11225] [ruby-core:69469] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r--ext/socket/ancdata.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index ea55534..756cf7e 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1151,11 +1151,8 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock)
if (argc == 0)
rb_raise(rb_eArgError, "mesg argument required");
-#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
+
rb_scan_args(argc, argv, "12*", &data, &vflags, &dest_sockaddr, &controls);
-#else
- rb_scan_args(argc, argv, "12", &data, &vflags, &dest_sockaddr);
-#endif
StringValue(data);
controls_num = RARRAY_LENINT(controls);