diff --git a/ChangeLog b/ChangeLog index 71f4fe38b1..7343398ed0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Jun 6 01:00:06 2015 Naohisa Goto + + * 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] + Fri Jun 5 22:37:42 2015 Koichi Sasada * class.c (ins_methods_push): change 3rd parameter's type diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index ea55534d97..756cf7ed64 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);