<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -58,7 +58,6 @@ import org.jruby.RubyObject;
 import org.jruby.RubyObjectAdapter;
 import org.jruby.RubyString;
 import org.jruby.anno.JRubyMethod;
-import org.jruby.exceptions.RaiseException;
 import org.jruby.javasupport.JavaEmbedUtils;
 import org.jruby.runtime.Arity;
 import org.jruby.runtime.Block;
@@ -414,6 +413,9 @@ public class SSLSocket extends RubyObject {
         if(len == 0) {
             return str;
         }
+        if (len &lt; 0) {
+            throw runtime.newArgumentError(&quot;negative string size (or size too big)&quot;);
+        }
 
         // So we need to make sure to only block when there is no data left to process
         if(engine == null || !(peerAppData.hasRemaining() || peerNetData.position() &gt; 0)) {</diff>
      <filename>src/java/org/jruby/ext/openssl/SSLSocket.java</filename>
    </modified>
    <modified>
      <diff>@@ -169,6 +169,8 @@ class OpenSSL::TestSSL &lt; Test::Unit::TestCase
       ssl.sync_close = true
       ssl.connect
 
+      assert_raises(ArgumentError) { ssl.sysread(-1) }
+
       # syswrite and sysread
       ITERATIONS.times{|i|
         str = &quot;x&quot; * 100 + &quot;\n&quot;</diff>
      <filename>test/openssl/test_ssl.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e9af132782cc980cd5a986584937ffa7b9e5de37</id>
    </parent>
  </parents>
  <author>
    <name>Charles Oliver Nutter</name>
    <email>headius@headius.com</email>
  </author>
  <url>http://github.com/jruby/jruby-openssl/commit/30866643501a93c3daecf0535018c3784ee7c95a</url>
  <id>30866643501a93c3daecf0535018c3784ee7c95a</id>
  <committed-date>2009-10-27T06:57:09-07:00</committed-date>
  <authored-date>2009-10-27T06:57:09-07:00</authored-date>
  <message>Possible &quot;fix&quot; for JRUBY-3829: ByteBuffer.java:328:in `allocate': java.lang.IllegalArgumentException when returning SOAP queries over a certain size</message>
  <tree>24acf697962af805bc2da0e51000adadaa5d4cbb</tree>
  <committer>
    <name>Charles Oliver Nutter</name>
    <email>headius@headius.com</email>
  </committer>
</commit>
