Skip to content

Commit

Permalink
webui: Fix infinite loop when trying to log in with invalid account
Browse files Browse the repository at this point in the history
Close socket on fwrite() error. fwrite() returns the number of bytes
written, or false on error.

Fixes #1324: Infinite loop when trying to log with invalid account

(cherry picked from commit 2f58278)
  • Loading branch information
fbergkemper committed Jun 28, 2021
1 parent b822ff4 commit c821721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php
Expand Up @@ -217,7 +217,7 @@ private function send($msg)
$str_length += 4;
while($this->socket && $str_length > 0) {
$send = fwrite($this->socket, $msg, $str_length);
if($send === 0) {
if($send === 0 || $send === false) {
fclose($this->socket);
$this->socket = null;
return false;
Expand Down

0 comments on commit c821721

Please sign in to comment.