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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user