From 4d373a84113479fbcefc8bfd1a88ad051f05c5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 23 Oct 2026 18:45:28 +0200 Subject: [PATCH 1/2] wixl: update wxi for current rawhide mingw packages The mingw packages in Fedora rawhide renamed or dropped files that the wxi includes still reference, which makes the wxi validation tests fail: - libxml2: bin/libxml2-2.dll is now bin/libxml2-16.dll - libopenjph: bin/libopenjph-0.29.dll is now bin/libopenjph-0.32.dll - gstreamer1-plugins-bad-free: bin/libgsthip-0.dll is now bin/libgsthip-1.0-0.dll, and a kk translation was added - gsettings-desktop-schemas no longer ships the GConf .convert files in share/GConf/gsettings, so drop them libxml2, libopenjph and gstreamer1-plugins-bad-free are regenerated with data/wxi-update.py; gsettings-desktop-schemas is edited by hand since it has no .heat/.ignore sidecars. --- data/wixl/gsettings-desktop-schemas.wxi | 12 -- data/wixl/gstreamer1-plugins-bad-free.wxi | 222 +++++++++++----------- data/wixl/libopenjph.wxi | 10 +- data/wixl/libxml2.wxi | 12 +- 4 files changed, 126 insertions(+), 130 deletions(-) diff --git a/data/wixl/gsettings-desktop-schemas.wxi b/data/wixl/gsettings-desktop-schemas.wxi index aacd265..5b92301 100644 --- a/data/wixl/gsettings-desktop-schemas.wxi +++ b/data/wixl/gsettings-desktop-schemas.wxi @@ -3,16 +3,6 @@ - - - - - - - - - - @@ -559,8 +549,6 @@ - - diff --git a/data/wixl/gstreamer1-plugins-bad-free.wxi b/data/wixl/gstreamer1-plugins-bad-free.wxi index 272b26b..1dec954 100644 --- a/data/wixl/gstreamer1-plugins-bad-free.wxi +++ b/data/wixl/gstreamer1-plugins-bad-free.wxi @@ -15,7 +15,7 @@ - + @@ -52,8 +52,8 @@ - - + + @@ -89,9 +89,9 @@ - - - + + + @@ -395,15 +395,15 @@ - - - - + + + + - + @@ -432,329 +432,336 @@ - + - + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -791,7 +798,7 @@ - + @@ -939,6 +946,7 @@ + @@ -963,5 +971,5 @@ - - + + diff --git a/data/wixl/libopenjph.wxi b/data/wixl/libopenjph.wxi index ef992dc..9422b8d 100644 --- a/data/wixl/libopenjph.wxi +++ b/data/wixl/libopenjph.wxi @@ -3,9 +3,9 @@ - - - + + + @@ -13,9 +13,9 @@ - + - + diff --git a/data/wixl/libxml2.wxi b/data/wixl/libxml2.wxi index fbe1978..e7d83b1 100644 --- a/data/wixl/libxml2.wxi +++ b/data/wixl/libxml2.wxi @@ -4,9 +4,9 @@ - - - + + + @@ -24,12 +24,12 @@ - + - - + + -- GitLab From fc2daea77a1186a946304c930727223333266a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 23 Oct 2026 18:48:29 +0200 Subject: [PATCH 2/2] libmsi: open 0-byte streams with libgsf >= 1.14.59 Since libgsf 1.14.59 (commit fbe366e "OLE2: fix some edge cases"), gsf_infile_msole fails to open a 0-byte stream stored in small blocks and reports "Insufficient memory". An empty database has such streams (_StringData, _Tables), so after libmsi_database_commit() reopens the file the string table cannot be loaded, db->strings stays NULL and the next commit crashes in string_totalsize(). This makes msibuild and testdatabase segfault. When reading table streams and caching the database structure, open children through msi_infile_child_by_index/_by_name, which return an empty stream for a child that exists but cannot be opened. They call the GsfInfile vfuncs directly because libgsf's wrappers g_warning() on every child that fails to open, which the bats tests, comparing stderr, would flag. The proper fix is in libgsf and is submitted there separately. --- libmsi/libmsi-database.c | 2 +- libmsi/msipriv.h | 2 ++ libmsi/table.c | 56 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/libmsi/libmsi-database.c b/libmsi/libmsi-database.c index fa336d1..e109317 100644 --- a/libmsi/libmsi-database.c +++ b/libmsi/libmsi-database.c @@ -2118,7 +2118,7 @@ static void cache_infile_structure( LibmsiDatabase *db ) for (i = 0; i < n; i++) { - GsfInput *in = gsf_infile_child_by_index(db->infile, i); + GsfInput *in = msi_infile_child_by_index(db->infile, i); const char* name = gsf_input_name(in); const uint8_t *name8 = (const uint8_t *)name; diff --git a/libmsi/msipriv.h b/libmsi/msipriv.h index 086dd55..c1ceb49 100644 --- a/libmsi/msipriv.h +++ b/libmsi/msipriv.h @@ -388,6 +388,8 @@ extern bool _libmsi_record_compare_fields(const LibmsiRecord *a, const LibmsiRec /* stream internals */ extern void enum_stream_names( GsfInfile *stg ); +extern GsfInput *msi_infile_child_by_index( GsfInfile *stg, int i ); +extern GsfInput *msi_infile_child_by_name( GsfInfile *stg, const char *name ); extern char *encode_streamname(bool bTable, const char *in); extern char *decode_streamname(const char *in); diff --git a/libmsi/table.c b/libmsi/table.c index 5e0a6f8..f095944 100644 --- a/libmsi/table.c +++ b/libmsi/table.c @@ -20,6 +20,7 @@ #include #include +#include #include "libmsi.h" #include "msipriv.h" @@ -252,6 +253,59 @@ void enum_stream_names( GsfInfile *stg ) } } +/* + * libgsf >= 1.14.59 (commit fbe366e) fails to open 0-byte streams that + * are stored in small blocks, such as an empty _StringData or _Tables. + * Return an empty stream for a child that exists but cannot be opened. + * The child_by_* vfuncs are called directly so that libgsf does not + * print a warning for every such stream. + */ +#define INFILE_GET_CLASS(stg) G_TYPE_INSTANCE_GET_CLASS( stg, GSF_INFILE_TYPE, GsfInfileClass ) + +static GsfInput *empty_child( GsfInput *stm, const char *name, GError *err ) +{ + static const uint8_t empty[1]; + + g_debug("opening stream %s failed (%s), assuming it is empty", + name, err->message); + g_error_free( err ); + if (stm) + g_object_unref( stm ); + + stm = gsf_input_memory_new( empty, 0, false ); + gsf_input_set_name( stm, name ); + return stm; +} + +GsfInput *msi_infile_child_by_index( GsfInfile *stg, int i ) +{ + GError *err = NULL; + GsfInput *stm; + + g_return_val_if_fail( GSF_IS_INFILE( stg ), NULL ); + + stm = INFILE_GET_CLASS( stg )->child_by_index( stg, i, &err ); + if (!err) + return stm; + + return empty_child( stm, gsf_infile_name_by_index( stg, i ), err ); +} + +GsfInput *msi_infile_child_by_name( GsfInfile *stg, const char *name ) +{ + GError *err = NULL; + GsfInput *stm; + + g_return_val_if_fail( GSF_IS_INFILE( stg ), NULL ); + g_return_val_if_fail( name != NULL, NULL ); + + stm = INFILE_GET_CLASS( stg )->child_by_name( stg, name, &err ); + if (!err) + return stm; + + return empty_child( stm, name, err ); +} + unsigned read_stream_data( GsfInfile *stg, const char *stname, uint8_t **pdata, unsigned *psz ) { @@ -268,7 +322,7 @@ unsigned read_stream_data( GsfInfile *stg, const char *stname, if ( !stg ) return LIBMSI_RESULT_FUNCTION_FAILED; - stm = gsf_infile_child_by_name(stg, encname ); + stm = msi_infile_child_by_name(stg, encname ); msi_free(encname); if( !stm ) { -- GitLab