Skip to content

Commit

Permalink
Make sure we never try to read more then the max buffer size in JRuby…
Browse files Browse the repository at this point in the history
…::Pump.
  • Loading branch information
jarib committed Feb 5, 2012
1 parent 701f486 commit 5a23289
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/childprocess/jruby/pump.rb
Expand Up @@ -30,6 +30,7 @@ def pump


while read != -1 while read != -1
avail = [@input.available, 1].max avail = [@input.available, 1].max
avail = BUFFER_SIZE if avail > BUFFER_SIZE
read = @input.read(buffer, 0, avail) read = @input.read(buffer, 0, avail)


if read > 0 if read > 0
Expand Down

0 comments on commit 5a23289

Please sign in to comment.