mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-18 11:35:15 -04:00
fix: null-check StorageId column in Monitor::Load to prevent segfault
dbrow[col] for StorageId can be NULL when the database column contains a NULL value. Passing NULL to atoi causes a segfault in strtol. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -388,7 +388,7 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) {
|
||||
server_id = dbrow[col] ? atoi(dbrow[col]) : 0;
|
||||
col++;
|
||||
|
||||
storage_id = atoi(dbrow[col]);
|
||||
storage_id = dbrow[col] ? atoi(dbrow[col]) : 0;
|
||||
col++;
|
||||
delete storage;
|
||||
storage = new Storage(storage_id);
|
||||
|
||||
Reference in New Issue
Block a user