Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.5.6, JRuby 1.6RC1, JRuby 1.6RC2
-
Fix Version/s: JRuby 1.6RC3
-
Component/s: Extensions
-
Labels:None
-
Number of attachments :
Description
org.jruby.ext.socket.RubyUnixSocket#recvfrom() allocates a fixed size native buffer of 1024 bytes, but then proceeds to read however many bytes the caller requested into that buffer.
so, a call of e.g. recvfrom(2048) could overflow the temporary buffer and crash the VM.
Now allocates a java heap buffer of exactly the size requested.