32073 Commits

Author SHA1 Message Date
Philip Withnall
e33be08bda 2.86.0
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.86.0
2025-09-05 13:42:14 +01:00
Philip Withnall
56136cb804 Merge branch 'Persian' into 'main'
po: Update Persian translation.

See merge request GNOME/glib!4772
2025-09-05 12:22:30 +00:00
Danial Behzadi
831c4f7f83 po: Update Persian translation. 2025-09-05 15:25:47 +03:30
Philip Withnall
20b023a287 Merge branch 'gmessages_win32_debug' into 'main'
gmessages: Fix win32_keep_fatal_message regression

See merge request GNOME/glib!4768
2025-09-05 08:57:03 +00:00
Philip Withnall
2b7346e088 Merge branch 'main' into 'main'
Update Georgian translation

See merge request GNOME/glib!4771
2025-09-05 08:51:10 +00:00
Philip Withnall
fad50ad4e2 Merge branch 'translation' into 'main'
Update Chinese translation

See merge request GNOME/glib!4770
2025-09-05 08:51:03 +00:00
NorwayFun
edc81fa803 Update ka.po 2025-09-04 12:34:17 +00:00
lumingzh
698ecdfc1a update Chinese translation 2025-09-04 17:47:56 +08:00
Michael Catanzaro
8a6f6b352e Merge branch 'typos' into 'main'
docs: Fix typos

See merge request GNOME/glib!4769
2025-09-03 16:37:07 -05:00
Tobias Stoeckmann
48bf508bc1 docs: Fix typos
Typos found with codespell
2025-09-03 21:47:11 +02:00
Tobias Stoeckmann
3d21160b85 docs: Fix typos in comments 2025-09-03 21:33:53 +02:00
Tobias Stoeckmann
19dce43557 gstring: Fix argument reference
The argument is named init, not data.
2025-09-03 21:33:35 +02:00
Tobias Stoeckmann
795ca50a98 gmessages: Fix win32_keep_fatal_message regression
The functionality of win32_keep_fatal_message was lost with commit
fb9df27776, which introduced the usage of
fputs instead of write. The write system call was wrapped with a macro
for Windows systems to keep fatal messages in an extra buffer.

For the record, the unused dowrite function was removed in commit
5400f4e128.

Reintroduce the functionality to fix this regression in a memory-safe
way.
2025-09-03 19:40:51 +02:00
Tobias Stoeckmann
b030663112 gmessages: Add static variables only if needed
The static variables win32_keep_fatal_message and fatal_msg_buf are only
used for Windows debug builds and those without G_WINAPI_ONLY_APP
defined.

These checks are already in place for consumer of fatal_msg_buf, so
extend their usage.
2025-09-03 19:37:38 +02:00
Philip Withnall
b9d2fa3cdc Merge branch 'solaris-faccessat' into 'main'
glocalfile: Disable faccessat()-based query_exists on Solaris

See merge request GNOME/glib!4767
2025-09-02 18:32:04 +00:00
Marco Trevisan
72a1b2a50b Merge branch 'girepository-null-pointer-dereference' into 'main'
girepository: Add an assertion to help scan-build

See merge request GNOME/glib!4765
2025-09-02 18:53:59 +02:00
Philip Withnall
5bc310bf9e girepository: Add an assertion to help scan-build
This helps scan-build not emit a ‘potential null pointer dereference’
error for calls to `require_internal()`:
```
Access to field 'message' results in a dereference of a null pointer (loaded from variable 'local_error')
```

See https://gitlab.gnome.org/GNOME/glib/-/jobs/5482526 for details of
the error.

I don’t think there is an actual null pointer dereference here.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-09-02 16:02:26 +01:00
Niveditha Rau
f607ae6511 glocalfile: Disable faccessat()-based query_exists on Solaris 2025-09-01 13:56:21 -07:00
Philip Withnall
813c615be4 Merge branch 'gmemorymonitorpsi-avoid-regex' into 'main'
gio: gmemorymonitorpsi: Replace GRegex with g_str_has_prefix()

See merge request GNOME/glib!4762
2025-08-30 13:31:39 +00:00
Kleis Auke Wolthuizen
e506d16efa gio: gmemorymonitorpsi: Replace GRegex with g_str_has_prefix()
Using g_str_has_prefix() and simple pointer arithmetic is easier and
more efficient.

No functional change.
2025-08-30 13:31:38 +00:00
Emmanuele Bassi
cb074a65c7 Merge branch 'gir-gio-unix-split' into 'main'
girepository: Remove backward compatibility introspection from Gio-2.0

Closes #3744

See merge request GNOME/glib!4761
2025-08-29 18:26:18 +01:00
Emmanuele Bassi
e13fe685cf docs: Fix links to GioUnix types
Now that Unix-specific types have been moved to the GioUnix, we need to
fix the various links in our documentation.
2025-08-29 18:00:50 +01:00
Emmanuele Bassi
45640dffa5 girepository: Load platform-specific GIO data
For backward compatibility, we automatically load the GioUnix or
GioWin32 namespaces if the Gio namespace has been required.

Also ensures that the platform-specific library is loaded in tests

Co-Authored-By: Marco Trevisan (Treviño) <mail@3v1n0.net>
2025-08-29 14:32:08 +02:00
Marco Trevisan (Treviño)
10366ac62f girepository: Add checks on prerequisites of gi_repository_require 2025-08-29 14:29:58 +02:00
Marco Trevisan (Treviño)
fd262e72f5 girepository: Fix indentation 2025-08-29 14:29:58 +02:00
Marco Trevisan (Treviño)
a1bc53aa98 girepository: Add test ensuring that platform specific methods are available 2025-08-29 14:29:33 +02:00
Emmanuele Bassi
db96cb45ce Remove backward compatibility introspection from Gio-2.0
The identifiers and types in Gio-2.0 that are used for backward
compatibility purposes in order to keep code importing Gio and using
platform-specific API are actually breaking the platform-specific
introspection data, because the introspection scanner favours types
found inside dependencies as opposed to types with the same name found
inside the current namespace.

In practice, the backward compatibility hack of keeping duplicate types
inside Gio-2.0 is effectively preventing people from using GioUnix-2.0
and GioWin32-2.0.

We cannot change the introspection scanner, because that could have
unforeseen results across the stack.

We cannot remove the symbols and bump the namespace version of Gio and
friends to 3.0, unless we keep generating known-to-be-broken 2.0
versions of all the namespaces. It also won't solve the issue of code
loading Gio without specifying a version, because that always imples
using the latest version of the namespace, which means backward
compatibility would still need an explicit opt in.

In practice, the only reasonable way forward is to break backward
compatibility, and remove the duplicate symbols and identifiers from
Gio-2.0, as we should have done in the first place.

Fixes: #3744
2025-08-29 14:02:44 +02:00
Marco Trevisan (Treviño)
8f25f70fc9 girepository: Always use internal functions in internal implementations
We are going to have a different logic in the public function so let's
just use the same code internally
2025-08-29 14:02:44 +02:00
Philip Withnall
0a017b39c2 Merge branch 'update-sv-translation' into 'main'
Update Swedish translation

See merge request GNOME/glib!4758
2025-08-27 14:18:03 +00:00
Philip Withnall
fa46da5804 Merge branch 'piotrdrag/pl-translation-250825' into 'main'
Update Polish translation 250825

See merge request GNOME/glib!4754
2025-08-26 19:17:52 +00:00
Anders Jonsson
c0c00844ae Update Swedish translation 2025-08-26 21:11:21 +02:00
Marco Trevisan
1e7fab4065 Merge branch '3768-test-trap-subprocess-flags' into 'main'
gtestutils: Fix G_TEST_SUBPROCESS_INHERIT_STDIN in g_test_trap_subprocess()

Closes #3768

See merge request GNOME/glib!4757
2025-08-26 17:14:00 +02:00
Philip Withnall
2f737c4e79 gtestutils: Fix G_TEST_SUBPROCESS_INHERIT_STDIN in g_test_trap_subprocess()
Spotted by Vincent Fazio. The old flag value was incorrectly used
instead of the new one when testing to see which flags were set. Likely
a typo.

This will never have worked, because the first few lines of the function
assert that the old flag value is not set.

Includes a unit test so we don’t regress on this in future.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Reported-by: Vincent Fazio <vfazio@gmail.com>

Fixes: #3768
2025-08-26 15:56:56 +01:00
Piotr Drąg
073135b8c9 Update Polish translation 2025-08-25 18:23:15 +02:00
Michael Catanzaro
2735b2b331 Merge branch 'strv-docs-example' into 'main'
gtestutils: Fix a slightly broken example in a doc comment

See merge request GNOME/glib!4751
2025-08-22 10:36:02 -05:00
Philip Withnall
354344fe59 2.85.4
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.85.4
2025-08-22 13:29:34 +01:00
Philip Withnall
c8c3c7f5bd Merge branch 'sl-po' into 'main'
Update Slovenian translation

Closes #3766

See merge request GNOME/glib!4752
2025-08-22 12:09:38 +00:00
Martin
9b11cc0900 Update Slovenian translation
Submitted at https://gitlab.gnome.org/GNOME/glib/-/issues/3766,
committed by Philip Withnall.

Fixes: #3766
2025-08-22 12:52:19 +01:00
Philip Withnall
3894bec664 gtestutils: Fix a slightly broken example in a doc comment
`GStrv` can only be used with `g_auto`, not `g_autoptr`.

Guess who just copied and pasted this code example and found it didn’t
compile?

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-08-21 21:17:07 +01:00
Philip Withnall
b026819ca1 Merge branch 'windows-skip-socket-mock' into 'main'
tests/gio: skip Unix socket-mock tests on Windows

See merge request GNOME/glib!4744
2025-08-21 14:31:24 +00:00
Philip Withnall
5e8cc2559d Merge branch 'gmessage_recursion' into 'main'
gmessages: Fix stack overflow with many fields

Closes #3760

See merge request GNOME/glib!4750
2025-08-21 14:29:35 +00:00
Philip Withnall
2aac71dc33 Merge branch 'ghash_3724' into 'main'
ghash: Handle hash tables with millions of entries

Closes #3724

See merge request GNOME/glib!4749
2025-08-21 14:26:46 +00:00
Tobias Stoeckmann
c8730c7e8c gmessages: Avoid magic numbers
Use G_N_ELEMENTS macro to show exactly what these numbers 16 and 32 mean
in context of g_log_structured function.

Suggested by Marco Trevisan
2025-08-21 16:11:53 +02:00
Tobias Stoeckmann
e229be8f32 gmessages: Fix stack overflow with many fields
If g_log_structured is called recursively with more than 16 fields,
then n_fields is larger than the stack array, leading to an eventual
read overflow into the message buffer.

Either the message can be properly prepared by an attacker or many
bytes are left uninitialized (and potentially prepared through
previous function calls by the attacker), which could lead to
information leaks through logs.

Since such a recursive overflow can only be triggered with test
code (or users explicitly supplying G_LOG_FLAG_RECURSION), this is
no security threat.

Closes #3760
2025-08-21 16:10:16 +02:00
Tobias Stoeckmann
b32aed174a ghash: Call g_error if hash table grows too large
Gracefully handle the case when too many items (billions) are added to a
hash table.
2025-08-21 10:47:32 +02:00
Tobias Stoeckmann
4bc794e42a ghash: Handle hash tables with millions of entries
Multiplying a guint value with BIG_ENTRY_SIZE (8) can overflow the guint
data type if size reaches 2^29. Use the correct size_t type for 64 bit
systems to support such allocations.

A 32 bit system should fail its reallocation way earlier before reaching
such a large "size", i.e. item count, especially when reallocating.
Also, it would multiply with 4.

Closes #3724
2025-08-21 10:47:31 +02:00
Michael Catanzaro
08872dcd47 Merge branch 'constructor-private-add-attribute-used' into 'main'
gconstructor: Add attribute used for TLS callback pointer

See merge request GNOME/glib!4748
2025-08-20 10:43:26 -05:00
Luca Bacci
004ff59828 gconstructor: Add attribute used for TLS callback pointer
This is needed to ensure that the pointer is not removed
by an optimization pass. Theoretically, we'd have to add
both 'used' and 'retain' attributes, however for PE targets
'used' includes the effect of 'retain' [1], and GCC warns
if 'retain' is used in PE targets.

Fixes the constructor test in LTO builds.

[1] https://reviews.llvm.org/D96838
2025-08-20 14:00:38 +02:00
Marco Trevisan
99886f2d66 Merge branch 'utf8-gir-fix' into 'main'
gutf8: add introspection type for `end` parameter of `validate*` fn's

Closes #3743

See merge request GNOME/glib!4745
2025-08-20 02:16:12 +02:00
two
98a3dcb7e0 Merge branch glib:main into utf8-gir-fix 2025-08-19 21:13:09 +00:00