Do not assume the metainfo file is NUL-terminated

This was only true by accident. We'll need another fix for the LVFS to
add the missing NUL to restore compatibility for older clients.

Fixes https://github.com/fwupd/fwupd/issues/3533
This commit is contained in:
Richard Hughes 2021-07-23 11:19:51 +01:00
parent 5a6dccfa69
commit ae48e02ac2

View File

@ -485,10 +485,10 @@ fu_cabinet_build_silo_file (FuCabinet *self,
"no GBytes from GCabFile");
return FALSE;
}
if (!xb_builder_source_load_xml (source,
g_bytes_get_data (blob, NULL),
XB_BUILDER_SOURCE_FLAG_NONE,
&error_local)) {
if (!xb_builder_source_load_bytes (source,
blob,
XB_BUILDER_SOURCE_FLAG_NONE,
&error_local)) {
g_set_error (error,
FWUPD_ERROR,
FWUPD_ERROR_INVALID_FILE,