Permalink
Browse files

Better version of the fix for infinite loops.

This is the patch originally suggested by the Eric Cholet, who found the bug.
  • Loading branch information...
1 parent 6ac04c1 commit 5fd094cbda162a5421df70228d642bff2501412f @rjray committed Aug 15, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Apache/RPC/Server.pm
View
6 lib/Apache/RPC/Server.pm
@@ -160,7 +160,11 @@ sub handler ($$) ## no critic (ProhibitExcessComplexity)
$r->read($content, ($length < 2048) ? $length : 2048);
# If $content is undef, then the client has closed the connection
# on its end, and we're done (like it or not).
- last if (! defined $content);
+ if (! defined $content)
+ {
+ $r->log_error("$me: Error reading request content");
+ return SERVER_ERROR;
+ }
$length -= length $content;
if ($do_compress)

0 comments on commit 5fd094c

Please sign in to comment.