glib/girepository
Philip Withnall 14d196a6c1
gitypelib: Fix iterating through typelib prefixes
The iteration code used `g_string_overwrite_len()` to try and simplify
buffer allocation and growth, but seemingly forgot to handle the fact
that it doesn’t nul-terminate what it overwrites: the method is intended
to be used to splice bits into longer strings, not to overwrite an
entire nul-terminated string.

This meant that when iterating over a comma-separated `c_prefix` like
`GUnix,G`, on the second iteration `g_string_overwrite_len()` would be
used to write `G` into index 0 of the already-set `GUnix` string in the
buffer, leading to the first iteration happening all over again and the
`G` prefix being ignored.

This led to symbols failing to be matched to the `GioUnix` typelib, even
though they should have been.

This will be checked by a test in the following commit.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3303
2024-05-16 22:47:29 +01:00
..
cmph Remove unused cmph files 2024-04-12 15:26:22 +01:00
compiler girepository: Provide placeholders for positional parameters 2024-02-28 11:27:15 +00:00
decompiler girepository: Provide placeholders for positional parameters 2024-02-28 11:27:15 +00:00
inspector girepository: Combine input file validation code paths in utilities 2024-02-26 18:10:56 +00:00
introspection girepository/introspection: Set asan option only on address sanitizer 2024-05-10 04:16:17 +02:00
tests girrepository/tests: Add full gir dependencies on tests 2024-05-09 15:48:58 +02:00
gdump.c girrepository: Replace usage of gsize with standard size_t 2024-01-16 18:40:42 +01:00
gi-dump-types.c girepository: Replace tabs with spaces in indentation 2024-01-16 17:30:37 +01:00
giarginfo.c girepository: Rename gi_arg_info_load_type() to gi_arg_info_load_type_info() 2024-02-05 15:13:46 +00:00
giarginfo.h girepository: Rename gi_arg_info_load_type() to gi_arg_info_load_type_info() 2024-02-05 15:13:46 +00:00
gibaseinfo-private.h gibaseinfo: Remove an unused private macro 2024-02-14 11:52:02 +00:00
gibaseinfo.c girepository: Fix various implicit conversions from size_t to smaller types 2024-04-25 00:41:34 +01:00
gibaseinfo.h girepository: Make GIInfoType private 2024-02-08 12:56:02 +00:00
gicallableinfo.c girepository: Fix various implicit conversions from size_t to smaller types 2024-04-25 00:41:34 +01:00
gicallableinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
gicallbackinfo.c gicallbackinfo: Port documentation to gi-docgen and update 2023-12-18 14:14:15 +00:00
gicallbackinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
giconstantinfo.c girrepository: Replace usage of gsize with standard size_t 2024-01-16 18:40:42 +01:00
giconstantinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
gienuminfo.c gibaseinfo: Rename gi_info_new() to gi_base_info_new() 2024-02-08 10:34:40 +00:00
gienuminfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
gifieldinfo.c girepository: Fix various implicit conversions from size_t to smaller types 2024-04-25 00:41:34 +01:00
gifieldinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
giflagsinfo.c gienuminfo: Split out GIFlagsInfo as a derived type 2024-01-18 13:15:22 +00:00
giflagsinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
gifunctioninfo.c gibaseinfo: Rename gi_info_new() to gi_base_info_new() 2024-02-08 10:34:40 +00:00
gifunctioninfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
giinterfaceinfo.c gibaseinfo: Rename gi_info_new() to gi_base_info_new() 2024-02-08 10:34:40 +00:00
giinterfaceinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
ginvoke.c girrepository: Use standard int sized types instead of g[u]int* 2024-01-16 18:40:42 +01:00
giobjectinfo.c gibaseinfo: Rename gi_info_new() to gi_base_info_new() 2024-02-08 10:34:40 +00:00
giobjectinfo.h girepository: Fix declaration of ‘find using interfaces’ methods 2024-02-05 18:40:03 +00:00
gipropertyinfo.c gipropertyinfo: Port documentation to gi-docgen and update 2023-12-18 14:14:15 +00:00
gipropertyinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
giregisteredtypeinfo.c gibaseinfo: Stop building GIBoxedInfo instances 2024-02-12 13:16:07 +00:00
giregisteredtypeinfo.h gibaseinfo: Stop building GIBoxedInfo instances 2024-02-12 13:16:07 +00:00
girepository-autocleanups.h girepository: Add g_autoptr() and g_auto() support 2024-02-14 11:54:48 +00:00
girepository-private.h girepository: Don't assume a bitfield has a fixed size 2024-05-15 12:09:21 +01:00
girepository.c girepository: Fix a typo in a code comment 2024-05-16 22:47:23 +01:00
girepository.h girepository: Add g_autoptr() and g_auto() support 2024-02-14 11:54:48 +00:00
girffi.c girffi: Fix ffi_cif leaks on error return paths 2024-04-12 18:45:18 +01:00
girffi.h girepository: Add g_autoptr() and g_auto() support 2024-02-14 11:54:48 +00:00
girmodule-private.h girepository: Various indentation cleanups 2024-01-16 18:56:57 +01:00
girmodule.c Merge branch 'typelib-bytes' into 'main' 2024-01-26 10:15:49 +00:00
girnode-private.h girnode: Improve int types in GIIrNodeUnion 2024-01-26 09:29:30 +00:00
girnode.c girepository: Fix various implicit conversions from size_t to smaller types 2024-04-25 00:41:34 +01:00
giroffsets.c girnode: Improve int types in GIIrNodeField 2024-01-26 09:29:30 +00:00
girparser-private.h girparser: Don't rely on gi-compile-repository exporting debug level 2024-02-14 10:36:34 +00:00
girparser.c girparser: Silence a scan-build NULL pointer dereference warning 2024-04-25 23:57:59 +01:00
girwriter-private.h girwriter: Take the GIRepository as a parameter 2024-02-14 11:13:04 +00:00
girwriter.c girepository: Fix various implicit conversions from size_t to smaller types 2024-04-25 00:41:34 +01:00
gisignalinfo.c gisignalinfo: Port documentation to gi-docgen and update 2023-12-18 14:14:16 +00:00
gisignalinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
gistructinfo.c gibaseinfo: Rename gi_info_new() to gi_base_info_new() 2024-02-08 10:34:40 +00:00
gistructinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
gitypeinfo.c girepository: Make GIInfoType private 2024-02-08 12:56:02 +00:00
gitypeinfo.h girepository: Make GIInfoType private 2024-02-08 12:56:02 +00:00
gitypelib-internal.h docs: spelling and grammar fixes 2024-04-01 11:01:06 +00:00
gitypelib.c gitypelib: Fix iterating through typelib prefixes 2024-05-16 22:47:29 +01:00
gitypelib.h gitypelib: Add boxed type 2024-02-07 21:07:18 +00:00
gitypes.h girepository: Drop GIBoxedInfo 2024-02-12 13:17:04 +00:00
giunioninfo.c Merge branch 'gi-info-new' into 'main' 2024-02-08 10:34:40 +00:00
giunioninfo.h giunioninfo: Split success and return value for get_discriminator_offset() 2024-02-06 13:34:17 +00:00
giunresolvedinfo.c giunresolvedinfo: Port documentation to gi-docgen and update 2023-12-18 14:14:16 +00:00
giunresolvedinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
givalueinfo.c girepository: Split GIValueInfo out of gienuminfo.c 2024-01-18 13:15:22 +00:00
givalueinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
givfuncinfo.c gibaseinfo: Rename gi_info_new() to gi_base_info_new() 2024-02-08 10:34:40 +00:00
givfuncinfo.h girepository: Add type-checking cast macros 2024-01-18 13:15:22 +00:00
gthash.c docs: spelling and grammar fixes 2024-04-01 11:01:06 +00:00
meson.build girepository: Fix static build under Windows 2024-02-21 12:38:40 +01:00