Skip to content

Commit

Permalink
Fixes #3916. RubyUDPSocket ArrayIndexOutOfBounds with v9.1.[01].0.
Browse files Browse the repository at this point in the history
Apparently we had two off-by-one arg processing mistakes which got
introduced in December o_O.
enebo committed May 25, 2016
1 parent fe84e89 commit 45f46df
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/ext/socket/RubyBasicSocket.java
Original file line number Diff line number Diff line change
@@ -216,11 +216,11 @@ public IRubyObject recv_nonblock(ThreadContext context, IRubyObject[] args) {

switch (argc) {
case 3:
str = args[3];
str = args[2];
case 2:
flags = args[2];
flags = args[1];
case 1:
length = args[1];
length = args[0];
}

boolean exception = ArgsUtil.extractKeywordArg(context, "exception", opts) != runtime.getFalse();
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/ext/socket/RubyUDPSocket.java
Original file line number Diff line number Diff line change
@@ -218,11 +218,11 @@ public IRubyObject recvfrom_nonblock(ThreadContext context, IRubyObject[] args)

switch (argc) {
case 3:
str = args[3];
str = args[2];
case 2:
flags = args[2];
flags = args[1];
case 1:
length = args[1];
length = args[0];
}

boolean exception = ArgsUtil.extractKeywordArg(context, "exception", opts) != runtime.getFalse();

0 comments on commit 45f46df

Please sign in to comment.