Merge branch 'filename-length' into 'main'

gwin32packageparser: Fix read past end of buffer

Closes #2454

See merge request GNOME/glib!2213
This commit is contained in:
LRN 2021-08-07 05:36:40 +00:00
commit 14f583bc23

View File

@ -390,7 +390,7 @@ g_win32_package_parser_enum_packages (GWin32PackageParserCallback callback,
wcs_path = LoadedWindowsGetStringRawBuffer (path, NULL);
manifest_filename_size = wcslen (wcs_path) + wcslen (bslash_appmanifest);
manifest_filename = g_new (wchar_t, manifest_filename_size + 1);
memcpy (manifest_filename, wcs_path, manifest_filename_size * sizeof (wchar_t));
memcpy (manifest_filename, wcs_path, wcslen (wcs_path) * sizeof (wchar_t));
memcpy (&manifest_filename[wcslen (wcs_path)], bslash_appmanifest, (wcslen (bslash_appmanifest) + 1) * sizeof (wchar_t));
memset (sax, 0, sizeof (*sax));