gibaseinfo: Ensure the typelib offset is within the allowed limits

Even though we expose the offset as a size_t value, we actually have
a less space for it, so let's ensure this is the case at runtime.
This commit is contained in:
Marco Trevisan (Treviño) 2024-01-16 01:18:23 +01:00
parent 157f93d2ee
commit acabaa1568

View File

@ -321,6 +321,7 @@ gi_info_new_full (GIInfoType type,
g_return_val_if_fail (container != NULL || repository != NULL, NULL);
g_return_val_if_fail (GI_IS_REPOSITORY (repository), NULL);
g_return_val_if_fail (offset <= G_MAXUINT32, NULL);
gi_base_info_init_types ();
g_assert (gi_base_info_types[type] != G_TYPE_INVALID);