From ae48e02ac23537acda110191d801c30c82e8f70e Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 23 Jul 2021 11:19:51 +0100 Subject: [PATCH] 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 --- libfwupdplugin/fu-cabinet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libfwupdplugin/fu-cabinet.c b/libfwupdplugin/fu-cabinet.c index 44c9897e5..0fc4ed53d 100644 --- a/libfwupdplugin/fu-cabinet.c +++ b/libfwupdplugin/fu-cabinet.c @@ -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,