mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-analyze: allow zero length embedded files
This commit is contained in:
@ -387,6 +387,7 @@ sysprof_document_lookup_file (GTask *task,
|
|||||||
g_autoptr(GByteArray) bytes = NULL;
|
g_autoptr(GByteArray) bytes = NULL;
|
||||||
const char *filename = task_data;
|
const char *filename = task_data;
|
||||||
GtkBitsetIter iter;
|
GtkBitsetIter iter;
|
||||||
|
gboolean was_found = FALSE;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_assert (G_IS_TASK (task));
|
g_assert (G_IS_TASK (task));
|
||||||
@ -422,6 +423,8 @@ sysprof_document_lookup_file (GTask *task,
|
|||||||
|
|
||||||
g_byte_array_append (bytes, data, size);
|
g_byte_array_append (bytes, data, size);
|
||||||
|
|
||||||
|
was_found = TRUE;
|
||||||
|
|
||||||
if (sysprof_document_file_chunk_get_is_last (file_chunk))
|
if (sysprof_document_file_chunk_get_is_last (file_chunk))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -430,7 +433,7 @@ sysprof_document_lookup_file (GTask *task,
|
|||||||
while (gtk_bitset_iter_next (&iter, &i));
|
while (gtk_bitset_iter_next (&iter, &i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bytes->len == 0)
|
if (!was_found)
|
||||||
g_task_return_new_error (task,
|
g_task_return_new_error (task,
|
||||||
G_IO_ERROR,
|
G_IO_ERROR,
|
||||||
G_IO_ERROR_NOT_FOUND,
|
G_IO_ERROR_NOT_FOUND,
|
||||||
|
|||||||
Reference in New Issue
Block a user