mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
sd-journal: add missing 'error' handling
When we reach an empty array, there are at least two possibilities: - journal file is corrupted, - invalid index is requested. We cannot distinguish them here, let's simply return earlier.
This commit is contained in:
parent
fe6f2bd8a6
commit
f85e79d3e5
@ -2788,6 +2788,9 @@ static int generic_array_get(
|
||||
return r;
|
||||
|
||||
k = journal_file_entry_array_n_items(f, o);
|
||||
if (k == 0)
|
||||
return 0;
|
||||
|
||||
if (i < k)
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user