Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.5
-
Fix Version/s: JRuby 1.2
-
Component/s: Application Error
-
Labels:None
-
Number of attachments :
Description
See http://gist.github.com/22786 for reproduce instructions.
Also affects JRuby 1.1.6. The fix follows:
Index: src/org/jruby/util/Pack.java
===================================================================
— src/org/jruby/util/Pack.java (revision 8454)
+++ src/org/jruby/util/Pack.java (working copy)
@@ -1105,7 +1105,8 @@
};
private static byte safeGet(ByteBuffer encode)
{ - return encode.hasRemaining() ? encode.get() : 0; + byte rb = encode.hasRemaining() ? encode.get() : 0; + return rb >= 0 ? rb : 0; }public static void decode(Ruby runtime, ByteBuffer encode, int occurrences,