mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
journal: Skip corrupt Data objects in sd_journal_get_data()
Similar to the change we made for sd_journal_enumerate_data(), let's skip corrupt entry items and data objects in sd_journal_get_data().
This commit is contained in:
@@ -2306,11 +2306,17 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **
|
||||
p = le64toh(o->entry.items[i].object_offset);
|
||||
le_hash = o->entry.items[i].hash;
|
||||
r = journal_file_move_to_object(f, OBJECT_DATA, p, &d);
|
||||
if (r == -EBADMSG) {
|
||||
log_debug("Entry item %"PRIu64" data object is bad, skipping over it.", i);
|
||||
continue;
|
||||
}
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (le_hash != d->data.hash)
|
||||
return -EBADMSG;
|
||||
if (le_hash != d->data.hash) {
|
||||
log_debug("Entry item %"PRIu64" hash is bad, skipping over it.", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
l = le64toh(d->object.size) - offsetof(Object, data.payload);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user