Skip to content

Commit

Permalink
Fixing #5490 - Avoid infinite recursion and crash in cacti_log (#5498)
Browse files Browse the repository at this point in the history
when database connection is lost.
  • Loading branch information
jsgh committed Sep 27, 2023
1 parent 49de3f6 commit 127c458
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -13,6 +13,7 @@ Cacti CHANGELOG
-issue#5221: ss_fping.php script times out when there is a lot of packet loss
-issue#5264: The Net-SNMP Disk I/O Templates are not Cluster Aware
-issue#5481: Attempting to edit a Data Query that does not exist throws warnings and not an GUI error
-issue#5490: Database failure causes infinite recursion in cacti_log() followed by machine lockup
-feature#412: Import Export for Graph and Tree rules
-feature#1214: Move Tree Create/Remove/Modify Functions to lib/api_tree.php
-feature#1442: Add validation to GUI inputs
Expand Down
2 changes: 1 addition & 1 deletion lib/functions.php
Expand Up @@ -733,7 +733,7 @@ function read_config_option(string $config_name, bool $force = false):string|fal
if (isset($database_hostname) && isset($database_port) && isset($database_default) &&
isset($database_sessions["$database_hostname:$database_port:$database_default"])) {
// Get the database setting
$db_result = db_fetch_row_prepared('SELECT value FROM settings WHERE name = ?', array($config_name));
$db_result = db_fetch_row_prepared('SELECT value FROM settings WHERE name = ?', array($config_name), false);

if (cacti_sizeof($db_result)) {
$value = $db_result['value'];
Expand Down

0 comments on commit 127c458

Please sign in to comment.