Permalink
Browse files

git_http_controller fix for case where buf is nil, which it can be. S…

…ubmitted via email by Davil Vallejo
  • Loading branch information...
1 parent 1430580 commit af667f064f6335a08dc5b0f9daa4ff055d105c08 @ericpaulbishop committed Feb 25, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/controllers/git_http_controller.rb
@@ -109,11 +109,11 @@ def service_rpc(rpc)
render :text => proc { |response, output|
buf_length=131072
buf = @git_http_control_pipe.read(buf_length)
- while(buf.length == buf_length)
+ while( !(buf.nil?) && buf.length == buf_length)
output.write( buf )
buf = @git_http_control_pipe.read(buf_length)
end
- if(buf.length > 0)
+ if( !(buf.nil?) && buf.length > 0)
output.write( buf )
end
@git_http_control_pipe.close
@@ -192,11 +192,11 @@ def internal_send_file(reqfile, content_type)
render :text => proc { |response, output|
buf_length=131072
buf = @git_http_control_pipe.read(buf_length)
- while(buf.length == buf_length)
+ while( !(buf.nil?) && buf.length == buf_length)
output.write( buf )
buf = @git_http_control_pipe.read(buf_length)
end
- if(buf.length > 0)
+ if( !(buf.nil?) && buf.length > 0)
output.write( buf )
end
@git_http_control_pipe.close

0 comments on commit af667f0

Please sign in to comment.