mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
core: Handle zero-sized archives, improve fsck error message
This commit is contained in:
parent
8d926c3e36
commit
3321fa08d7
@ -417,6 +417,12 @@ ostree_content_stream_parse (GInputStream *input,
|
||||
(guint)archive_header_size, input_length);
|
||||
goto out;
|
||||
}
|
||||
if (archive_header_size == 0)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"File header size is zero");
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Skip over padding */
|
||||
if (!g_input_stream_read_all (input,
|
||||
|
@ -217,7 +217,10 @@ fsck_reachable_objects_from_commits (OtFsckData *data,
|
||||
ot_clear_gvariant (&metadata);
|
||||
if (!ostree_repo_load_variant (data->repo, objtype,
|
||||
checksum, &metadata, error))
|
||||
goto out;
|
||||
{
|
||||
g_prefix_error (error, "Loading metadata object %s: ", checksum);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
|
||||
{
|
||||
@ -255,7 +258,10 @@ fsck_reachable_objects_from_commits (OtFsckData *data,
|
||||
guint32 mode;
|
||||
if (!ostree_repo_load_file (data->repo, checksum, &input, &file_info,
|
||||
&xattrs, cancellable, error))
|
||||
goto out;
|
||||
{
|
||||
g_prefix_error (error, "Loading file object %s: ", checksum);
|
||||
goto out;
|
||||
}
|
||||
|
||||
mode = g_file_info_get_attribute_uint32 (file_info, "unix::mode");
|
||||
if (!ostree_validate_structureof_file_mode (mode, error))
|
||||
|
Loading…
x
Reference in New Issue
Block a user