When collecting varargs, ignore the NOCOPY_CONTENTS
flag for variants. That is what our docs advice for
refcounted types, and it fixes a regression that
was inadvertendly introduced when we stopped doing
some extra GValue copies.
Includes a test case by Philip Withnall.
Fixes: #2774
This reverts commit 0ffe86a1f7e215e4561c3b9f1d03c3cd638ed00f.
This was intended to land for the 2.75.x unstable series, and not in the
2.74.x stable series.
Fixes: #2788
This reverts commit dd1f4f709ea8cad1a1d6184ee0883be128fb81d8.
which caused a regression on big-endian architectures (all doubles would
hash to zero).
Partially resolves#2787
Signed-off-by: Simon McVittie <smcv@collabora.com>
This reverts commit c1af4b2b886bd77d6d8857cf3f677edbc0d34a61,
which caused a regression on big-endian architectures (all 64-bit
integers would hash to zero).
Partially resolves#2787
Signed-off-by: Simon McVittie <smcv@collabora.com>
This reverts commit e02db8ea22d545749ecaf3be9d342cc565bc143a.
We can't guarantee a lack of hash collisions if we go back to the 2.74.0
hashing implementation.
Signed-off-by: Simon McVittie <smcv@collabora.com>
In case the XDG database is not initialized yet we may try to sniff a
0-length data, making our content-type routines to mark non-empty files
as `application/x-zerosize`.
This is wrong, so in case the sniff size is not set, let's just
try to read the default value. To avoid false-application/x-zerosize
results (that are not something we want as per legacy assumptions).
See: https://bugzilla.gnome.org/show_bug.cgi?id=755795
Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2742
Return `G_VARIANT_PARSE_ERROR_RECURSION` from `g_variant_parse()` if a
typedecl is found within a text-form variant which would cause any part
of the variant to exceed the maximum allowed recursion/nesting depth.
This fixes an oversight when `G_VARIANT_MAX_RECURSION_DEPTH` was
implemented, which allowed typedecls to effectively multiply the size of
an array if `g_variant_parse()` was parsing a text-form variant without
a top-level concrete type specified.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2782
oss-fuzz#49462
At the moment, glib assumes that if /etc/localtime is a symlink,
that it's a symlink to zoneinfo file.
Toolbx containers add an extra layer of indirection though, making
it a symlink to a symlink to a zoneinfo file.
This commit deals with the problem, by performing additional checks
on /etc/localtime and ignoring it if those check fail, falling back
instead to reading /etc/timezone.
Not that we ever expect it to fail. This is basically just to silence a
compiler warning with `-Werror=unused-result`.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2758
Otherwise, the build will fail when the toolchain is static-only, even
with -Ddefault_library=static. I talked to a Meson developer in their
IRC channel, who told me that the correct fix was to ensure that
shared_library is only used if default_library != static.
Check if thumbnails are created in the path we expect and that we can
retrieve their information, but also that we try to get the biggest size
available when multiple are available.
g_str_equal() is a nicer API than strcmp()==0, and less error prone.
However, forcing a function call prevents compiler from doing
optimizations. In the case it is not used as callback to GHashTable,
provide a macro that calls strcmp directly. This also has the side
effect that it forces arguments to be `const char *` instead of
`gconstpointer` in the case it is not used as callback, which adds type
safety.
Fixes: #2775