Fran Diéguez [Thu, 19 Dec 2013 00:17:25 +0000 (01:17 +0100)]
Updated Galician translations
Dan Winship [Wed, 18 Dec 2013 14:59:54 +0000 (09:59 -0500)]
Make g_test_run() return 77 if all tests are skipped
Change g_test_run() to return 1 on failure (rather than the number of
failed tests), and 77 if all tests are skipped (since automake and
some other test harnesses recognize that status code).
Previously g_test_run() returned the number of failed tests, but this
behavior was not documented, and at any rate, prior to 2.39,
g_test_run() would normally not return at all if an error occurred.
https://bugzilla.gnome.org/show_bug.cgi?id=720263
Dan Winship [Wed, 18 Dec 2013 14:29:29 +0000 (09:29 -0500)]
gtestutils: rename test_skip_count to test_startup_skip_count
https://bugzilla.gnome.org/show_bug.cgi?id=720263
Dan Winship [Wed, 11 Dec 2013 15:32:11 +0000 (16:32 +0100)]
gtestutils: skipping a test should count as success, not failure
In particular, the test program as a whole should exit with status 0
if you skipped some tests but did not fail any.
https://bugzilla.gnome.org/show_bug.cgi?id=720263
Bastien Nocera [Mon, 16 Dec 2013 16:21:41 +0000 (17:21 +0100)]
gdbus-codegen: Fix crasher in goa-using apps
When replacing a version of goa-daemon (from gnome-online-accounts)
by a newer version with some added interfaces, evolution-data-server
and the gvfs-goa volume monitor might crash as there's no interface
definition for this new interface.
Work-around this by returning earlier from the _notify() implementation,
rather than accessing invalid memory.
https://bugzilla.gnome.org/show_bug.cgi?id=720539
Tim Lunn [Tue, 17 Dec 2013 20:14:38 +0000 (07:14 +1100)]
Make gdb pretty-printers compatible with Python3
On some systems gdb is linked against python3 where "long" no longer
exists. In this case should be using int.
https://bugzilla.gnome.org/show_bug.cgi?id=720635
Damien Lespiau [Tue, 23 Mar 2010 15:18:12 +0000 (15:18 +0000)]
gobject.py: Don't install frame filters when GDB does not support them
Stock GDB (both versions 7.0 and 7.1) does not come with the new
backtrace code and python API. To prevent an ugly python backtrace when
auto-loading gobject.py, let's catch the exception and not register the
FrameWrapper and the FrameFilter.
https://bugzilla.gnome.org/show_bug.cgi?id=613732
Matthias Clasen [Tue, 17 Dec 2013 05:45:41 +0000 (00:45 -0500)]
Bump version
Matthias Clasen [Tue, 17 Dec 2013 05:30:08 +0000 (00:30 -0500)]
2.39.2
Ryan Lortie [Wed, 20 Nov 2013 21:57:26 +0000 (16:57 -0500)]
valgrind.h: add "r0" to the clobber list on PPC
Looks like the magic sequences trash this register, so make sure GCC
knows that.
https://bugzilla.gnome.org/show_bug.cgi?id=710983
Ryan Lortie [Wed, 11 Dec 2013 00:21:33 +0000 (19:21 -0500)]
tests: change test timezone to America/Toronto
America/Toronto is the canonical name for Canada/Eastern in the zoneinfo
database.
Matthias Clasen [Mon, 16 Dec 2013 02:06:35 +0000 (21:06 -0500)]
Expand the truncate tests
Check that the data is expanded with zeros.
Matthias Clasen [Mon, 16 Dec 2013 01:06:25 +0000 (20:06 -0500)]
Update tests for new truncate behavior
Stef Walter [Sat, 9 Nov 2013 19:23:01 +0000 (20:23 +0100)]
gdbus-export: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
Stef Walter [Sat, 9 Nov 2013 19:20:50 +0000 (20:20 +0100)]
gdbus-auth: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711802
Colin Walters [Mon, 16 Dec 2013 01:44:20 +0000 (20:44 -0500)]
gsubprocesslauncher: Annotate g_subprocess_launcher_spawnv()
Needs to be an array.
Stef Walter [Sat, 9 Nov 2013 19:27:57 +0000 (20:27 +0100)]
sources: Fix leaks in tests
https://bugzilla.gnome.org/show_bug.cgi?id=711751
Matthias Clasen [Sun, 15 Dec 2013 23:50:49 +0000 (18:50 -0500)]
Fix up gsettings test
Ross Lagerwall [Sun, 8 Dec 2013 20:41:15 +0000 (22:41 +0200)]
gio: Update GMemoryOutputStream length after truncate
For GMemoryOutputStream, update valid_len when truncating so that
g_memory_output_stream_get_data_size () returns the correct result.
https://bugzilla.gnome.org/show_bug.cgi?id=720080
Matthias Clasen [Sun, 15 Dec 2013 16:20:19 +0000 (11:20 -0500)]
Simplify subprocesses in tests
Use the new way of running tests in a subprocess without
registering extra 'subprocess' test cases where appropriate.
Stef Walter [Wed, 11 Dec 2013 08:31:35 +0000 (09:31 +0100)]
gtestutils: Allow clean simple use of g_test_trap_subprocess()
Allow g_test_trap_subprocess() to be used in a simple cases by
rerunning the same test case itself. This is accomplished by
passing %NULL as the test case name.
https://bugzilla.gnome.org/show_bug.cgi?id=720236
Matthias Clasen [Sun, 15 Dec 2013 04:54:18 +0000 (23:54 -0500)]
Add a testcase for g_ptr_array_insert
Matthias Clasen [Sun, 15 Dec 2013 04:45:36 +0000 (23:45 -0500)]
Add g_ptr_array_insert to the docs
Tristan Van Berkom [Wed, 27 Nov 2013 05:34:20 +0000 (14:34 +0900)]
GPtrArray: Added g_ptr_array_insert()
Speaks for itself, I've found myself on numerous occasions
writing my own version of this, or using a GArray of pointers.
https://bugzilla.gnome.org/show_bug.cgi?id=719395
Chun-wei Fan [Fri, 13 Dec 2013 08:21:00 +0000 (16:21 +0800)]
glib/gwin32.c: Silence a Deprecation Warning
Since we are already building a deprecated function for compatibility
reasons, we don't really need to see a warning when it uses another
deprecated GLib function.
Chun-wei Fan [Thu, 12 Dec 2013 10:00:52 +0000 (18:00 +0800)]
gio/gdbusaddress: Clean up Win32 code a bit
Combine duplicate parts into one, as the symbol used by RunDLL under x64
is the same for either Visual C++ or MinGW-64
Milo Casagrande [Thu, 12 Dec 2013 08:50:46 +0000 (09:50 +0100)]
[l10n] Updated Italian translation.
Matthias Clasen [Wed, 11 Dec 2013 15:35:45 +0000 (10:35 -0500)]
Remove an unused define
https://bugzilla.gnome.org/show_bug.cgi?id=720210
Martin Pitt [Wed, 11 Dec 2013 12:17:10 +0000 (13:17 +0100)]
gdesktopappinfo: Add missing annotations
Add missing (allow-none) annotations to
g_desktop_app_info_launch_uris_as_manager(). Tested with
python -c "from gi.repository import GLib, Gio; Gio.DesktopAppInfo.new('gcalctool.desktop').launch_uris_as_manager([], None, GLib.SpawnFlags.SEARCH_PATH|GLib.SpawnFlags.STDOUT_TO_DEV_NULL, None, None, None, None)"
which is necessary to do a launch_uris() without leaking stdout.
https://launchpad.net/bugs/1259721
Chun-wei Fan [Wed, 11 Dec 2013 12:09:59 +0000 (20:09 +0800)]
Update Visual C++ "Installation" Phase
Install the Python scripts that is used by gdbus-codegen in
share\glib-2.0\codegen, to be consistent with the other platforms.
Please see https://bugzilla.gnome.org/show_bug.cgi?id=702862 for details
on this.
Manuel Bachmann [Wed, 11 Dec 2013 09:59:28 +0000 (10:59 +0100)]
gdbus-codegen: look for deps in correct path under win32
codegen.py and friends get installed in "share/glib-2.0",
so look for them there.
https://bugzilla.gnome.org/show_bug.cgi?id=702862
Stef Walter [Wed, 4 Dec 2013 11:48:53 +0000 (12:48 +0100)]
gdbus-connection: Work around race in connection tests
GDBusConnection cleanup is inherently racy due to its use of worker
threads. Put tests that expect a NULL G_BUS_TYPE_SESSION singleton
as the first tests to work around cleanup races.
https://bugzilla.gnome.org/show_bug.cgi?id=719837
Ryan Lortie [Sun, 8 Dec 2013 23:18:16 +0000 (18:18 -0500)]
g_get_current_dir(): consult PWD first
Check if the current directory is the same as $PWD. This matches the
behaviour of the get_current_dir_name() function in glibc.
https://bugzilla.gnome.org/show_bug.cgi?id=705902
Lars Uebernickel [Sun, 8 Dec 2013 16:30:33 +0000 (17:30 +0100)]
g_settings_get: only check for non-copying format string
396d40af introduced a redundant call to g_variant_check_format_string().
Checking whether the format string copies all values is enough.
https://bugzilla.gnome.org/show_bug.cgi?id=719979
Ryan Lortie [Sun, 8 Dec 2013 21:38:47 +0000 (16:38 -0500)]
clang fixes: tweak last commit
We need to actually ignore "-Wformat-nonliteral" to make clang happy
Ryan Lortie [Sun, 8 Dec 2013 19:22:51 +0000 (14:22 -0500)]
[PATCH] Fix trivial non literal format uses
Based on a patch from Henrique Dante de Almeida <hdante@gmail.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=691608
keyring [Sat, 7 Dec 2013 07:05:26 +0000 (15:05 +0800)]
Update Chinese simplified translation
Lars Uebernickel [Fri, 6 Dec 2013 15:01:48 +0000 (16:01 +0100)]
g_settings_get: check validity of format string
Allow only format strings that copy all values (i.e, don't contain '&'),
as the returned pointers might become invalid in some rare cases.
Since this is technically an API break, this patch only prints a
critical when a faulty format string is detected, but still fetches the
values.
https://bugzilla.gnome.org/show_bug.cgi?id=719979
Philip Withnall [Tue, 3 Dec 2013 08:27:05 +0000 (08:27 +0000)]
gtestdbus: Add a note about thread safety to the documentation
https://bugzilla.gnome.org/show_bug.cgi?id=712148
Daiki Ueno [Thu, 5 Dec 2013 09:16:36 +0000 (18:16 +0900)]
Fix documentation typos in GTask and GCancellable examples
https://bugzilla.gnome.org/show_bug.cgi?id=719884
Colin Walters [Tue, 3 Dec 2013 22:15:14 +0000 (17:15 -0500)]
gsignal: Signal connection ids are always > 0 if successful
Note this explicitly so that people can rely on doing:
if (mystruct->sigid > 0)
g_signal_disconnect (mystruct->object, mystruct->sigid);
https://bugzilla.gnome.org/show_bug.cgi?id=719809
Marc-André Lureau [Tue, 26 Nov 2013 16:45:37 +0000 (17:45 +0100)]
gutf8: use g_try_malloc_n
As recommended by Christian Persch.
https://bugzilla.gnome.org/show_bug.cgi?id=711546
Marc-André Lureau [Tue, 3 Dec 2013 14:35:50 +0000 (15:35 +0100)]
gmessages: make _g_log_abort() do only breakpoints again
Commit
e53caad4 makes _g_log_abort() noreturn by calling abort()
unconditionally.
However, it is useful to be able to skip some log_abort() with a
debugger, to reach a point of interest. Revert back to previous
behaviour. Make g_assert_warning() noreturn by calling abort().
https://bugzilla.gnome.org/show_bug.cgi?id=711800
Matthias Clasen [Tue, 3 Dec 2013 03:26:48 +0000 (22:26 -0500)]
Remove g_trap_instance_signals as well
This is another crude conditional breakpoint mechanism and can
be done better with actual conditional breakpoints or with systemtap
tracepoints.
https://bugzilla.gnome.org/show_bug.cgi?id=719687
Matthias Clasen [Tue, 3 Dec 2013 02:48:03 +0000 (21:48 -0500)]
Drop g_trap_object_ref debugging mechanism
This is really just a very crude and limited conditional breakpoint.
Update the documentation to explain conditional breakpoints in
gdb instead. Also, remove the link to refdbg, which appears dead.
https://bugzilla.gnome.org/show_bug.cgi?id=719687
Xavier Claessens [Mon, 2 Dec 2013 19:37:23 +0000 (14:37 -0500)]
Document clearly async functions not copying its args
Usually async methods copy/ref its arguments so caller can
forget about them. g_file_replace_contents_async() and
g_output_stream_write_async() are exceptions.
https://bugzilla.gnome.org/show_bug.cgi?id=690525
Xavier Claessens [Mon, 2 Dec 2013 19:40:35 +0000 (14:40 -0500)]
GFile: add GBytes version of _replace_contents_async()
https://bugzilla.gnome.org/show_bug.cgi?id=690525
Colin Walters [Sun, 1 Dec 2013 23:52:37 +0000 (18:52 -0500)]
gsubprocess: Annotate g_subprocess_newv()
So that it can actually be invoked by bindings.
Chun-wei Fan [Mon, 2 Dec 2013 01:51:18 +0000 (09:51 +0800)]
build/win32/vs9/gio.vcprojin: Use UNIX Line endings
Be more consistent with the other project file templates, which will
simplify future application of patches.
Matthias Clasen [Sun, 1 Dec 2013 16:45:41 +0000 (11:45 -0500)]
Install all test data
The desktop-files directory contains a mimeapps.cache file
that was not installed as data for installed tests, causing
the file measure test to fail only in when installed.
Aurimas Černius [Sun, 1 Dec 2013 16:30:19 +0000 (18:30 +0200)]
Updated Lithuanian translation
Matthias Clasen [Sun, 1 Dec 2013 03:51:03 +0000 (22:51 -0500)]
Improve file measure testcase
Make the testcase compare the byte size to what is reported
by du. Also add a test for the async api, and mak eit test
the progress reporting callback.
Philip Withnall [Tue, 12 Nov 2013 13:14:19 +0000 (13:14 +0000)]
gtestdbus: Minor documentation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=712148
Philip Withnall [Tue, 12 Nov 2013 13:10:33 +0000 (13:10 +0000)]
gtestdbus: Fix non-const use of const variables
The argv array should be declared as const.
https://bugzilla.gnome.org/show_bug.cgi?id=712148
Philip Withnall [Tue, 12 Nov 2013 13:09:56 +0000 (13:09 +0000)]
gtestdbus: Fix variable shadowing
Shut up, GCC.
https://bugzilla.gnome.org/show_bug.cgi?id=712148
Matthias Clasen [Fri, 29 Nov 2013 05:11:47 +0000 (00:11 -0500)]
Add a test for g_file_measure_disk_usage
Colin Walters [Fri, 29 Nov 2013 04:12:26 +0000 (04:12 +0000)]
tests/gsubprocess: Only compare basename of /tmp
Otherwise, we break in Continuous where /tmp == /sysroot/tmp,
and something in the execve() or the kernel will do realpath()
for us.
Matthias Clasen [Fri, 29 Nov 2013 02:58:48 +0000 (21:58 -0500)]
Improve GType test coverage
Add a test for g_type_class_get_instance_private_offset
Matthias Clasen [Fri, 29 Nov 2013 02:58:25 +0000 (21:58 -0500)]
Add a test for g_atexit
Matthias Clasen [Fri, 29 Nov 2013 02:57:47 +0000 (21:57 -0500)]
Improve GApplication test coverage
Exercise more of the GActionMap implementation.
Matthias Clasen [Fri, 29 Nov 2013 02:56:48 +0000 (21:56 -0500)]
Improve GNotification test coverage
Matthias Clasen [Fri, 29 Nov 2013 02:53:53 +0000 (21:53 -0500)]
Improve GSimpleActionGroup test coverage
Add a case that overwrites an existing action.
Matthias Clasen [Thu, 28 Nov 2013 19:50:59 +0000 (14:50 -0500)]
Generate overview images for coverage
lcov has the options to generate overview images for each source
file with the --frames option. Lets try this.
Matthias Clasen [Thu, 28 Nov 2013 19:33:03 +0000 (14:33 -0500)]
Improve GSettings test coverage
This covers some more GSettingsSchemaKey api.
Matthias Clasen [Thu, 28 Nov 2013 18:54:50 +0000 (13:54 -0500)]
Improve search utils test coverage
This adds test cases for the Turkish i.
Matthias Clasen [Thu, 28 Nov 2013 18:54:17 +0000 (13:54 -0500)]
Improve GNotification test coverage
Matthias Clasen [Thu, 28 Nov 2013 18:00:03 +0000 (13:00 -0500)]
Improve GKeyFile test coverage
Matthias Clasen [Thu, 28 Nov 2013 17:59:32 +0000 (12:59 -0500)]
Improve test coverage for GHashTable
Matthias Clasen [Thu, 28 Nov 2013 17:59:11 +0000 (12:59 -0500)]
Improve test coverage for GSubprocess
Matthias Clasen [Thu, 28 Nov 2013 17:58:44 +0000 (12:58 -0500)]
Improve test coverage for gsettings
Matthias Clasen [Thu, 28 Nov 2013 07:01:48 +0000 (02:01 -0500)]
Test new gsettings api
g_settings_get_user_value and g_settings_get_default_value
are now covered.
Philip Withnall [Thu, 28 Nov 2013 20:41:49 +0000 (20:41 +0000)]
gio: Replace g_clear_object() with if()…g_object_unref()
As per https://bugzilla.gnome.org/show_bug.cgi?id=113075#c39.
djcb [Thu, 28 Nov 2013 13:25:20 +0000 (08:25 -0500)]
gdbus-codegen: Fix leak in property setter
Comparing the code generated for the setter and other methods without
(real) return value, I noticed that the setter does not unref the
gvariant it gets.
https://bugzilla.gnome.org/show_bug.cgi?id=719472
Matthias Clasen [Thu, 28 Nov 2013 06:36:29 +0000 (01:36 -0500)]
Test g_subprocess_launcher_spawn
The spawnv variant of this function already had a test, but
spawn was not tested.
Matthias Clasen [Thu, 28 Nov 2013 06:34:52 +0000 (01:34 -0500)]
Fix g_subprocess_launcher_spawn
This function turns a varargs argument list into a string array,
but forgets to NULL-terminate it. This function was not covered
by unit tests...so it was broken.
Matthias Clasen [Thu, 28 Nov 2013 06:12:26 +0000 (01:12 -0500)]
Test some more GSubProcess api
This covers g_subprocess_set_environ, g_subprocess_setenv,
g_subprocess_getenv, and g_subprocess_set_flags.
Matthias Clasen [Thu, 28 Nov 2013 05:19:19 +0000 (00:19 -0500)]
Add a GAppInfoMonitor test
The test reveals that there's something fishy with this monitor.
One has to call g_app_info_get_all() for it to start working,
and then it only works once.
Matthias Clasen [Thu, 28 Nov 2013 03:48:06 +0000 (22:48 -0500)]
Add tests for new GAction api
g_action_name_is_valid and g_action_parse_detailed_name are
now covered.
Manuel Bachmann [Wed, 27 Nov 2013 22:18:54 +0000 (23:18 +0100)]
Fix g_win32_run_session_bus hook for MinGW-w64
On win64, g_win32_run_session_bus gets exported with this
precise name, with MinGW as well as MSVC.
Fixes annoying "Entry not found" UI warning.
Ryan Lortie [Wed, 27 Nov 2013 17:41:33 +0000 (12:41 -0500)]
gsettings tool: stop using GMainLoop
Just iterate directly.
Ryan Lortie [Wed, 27 Nov 2013 17:40:27 +0000 (12:40 -0500)]
gsettings tool: fix some sed damage
The previous patch to simplify the GSettings commandline tool by making
more use of global variables went a bit too far and broke 'gsettings
monitor' when used without a specific key.
Fix that up again.
Dan Winship [Wed, 27 Nov 2013 15:57:43 +0000 (10:57 -0500)]
Fix a warning about _g_log_abort()
G_BREAKPOINT is not noreturn, so make it so that we abort() if it
returns, to make _g_log_abort() be properly noreturn again.
Dan Winship [Wed, 27 Nov 2013 15:15:44 +0000 (10:15 -0500)]
Fix the gtestutils core dump prevention again
The previous patch was preventing core dumps on failed assertions, but
not on g_error()s.
Rui Matos [Wed, 27 Nov 2013 13:32:05 +0000 (14:32 +0100)]
GDBusObjectManagerClient: keep the manager alive while firing signals
Handlers for the signals we emit might unref the object manager. Make
sure we keep it alive until we are done with it.
https://bugzilla.gnome.org/show_bug.cgi?id=719402
Ryan Lortie [Wed, 27 Nov 2013 15:13:10 +0000 (10:13 -0500)]
tests: move /param/implement to -m slow
Take this test out of 'make check'. It's causing problems for a lot of people
due to fact that it's essentially a forkbomb. It's causing failures for Debian
on ARM and it's DoSing coredumps to system crash collectors.
The conditional only covers registration of the master, not the
subprocess parts. This is because g_test_slow() always return FALSE in
the subprocesses, so they would fail to run if we didn't register them
unconditionally.
Philip Withnall [Mon, 25 Nov 2013 13:26:45 +0000 (13:26 +0000)]
gbytes: Clarify the nullability of GBytes->data
Clarify that it is permitted for a GBytes to contain a NULL data
pointer, as long as its size is 0.
https://bugzilla.gnome.org/show_bug.cgi?id=715164
Philip Withnall [Mon, 25 Nov 2013 14:06:01 +0000 (14:06 +0000)]
gfileutils: Fix a potential integer overflow
When calculating the array sizes in get_contents_stdio(), there is a
possibility of overflow for very large files. Rearrange the overflow
checks to avoid this.
The code already handled some possibilities of files being too large, so
no new GError has been added to handle this; the existing
G_FILE_ERROR_FAILED is re-used.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=715164
Philip Withnall [Mon, 25 Nov 2013 13:50:20 +0000 (13:50 +0000)]
gvariant: Fix a potential memcpy(NULL) call
This probably won’t crash, as it can only happen if (size == 0), but
add a check to be safe, and to shut up the static analyser.
This case can be reached with the following call:
gvs_read_unaligned_le(NULL, 0)
which can be called from:
gvs_tuple_get_child(value, index_)
with (value.data == NULL) and (value.size == 0).
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=715164
Philip Withnall [Tue, 26 Nov 2013 11:21:37 +0000 (11:21 +0000)]
gio/tests: Add a dynamic type check assertion
This shuts up a static analysis false positive, and adds some extra
checking.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:20:01 +0000 (11:20 +0000)]
gio/tests: Add a non-NULL assertion to help static analysis
The static analyser (correctly) considers a type check to fail if the
variable is NULL. In this case, the address must be non-NULL as no error
was thrown by g_socket_connection_get_remote_address(), but the static
analyser doesn’t know this.
Add a non-NULL assertion anyway, both to shut the analyser up, and
because it’s good extra testing.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:18:35 +0000 (11:18 +0000)]
gio/tests: Add non-NULL assertions to help static analysis
These prevent some false positives from the static analyser which are
caused by it not inspecting the invariants of
g_subprocess_communicate[_utf8]_finish() (i.e. that stdout and
stdout_str will always be set unless an error was returned).
They’re also good testing anyway.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:18:01 +0000 (11:18 +0000)]
gio/tests: Fix a g_return_val_if_fail() in a void function
Should be g_return_if_fail() instead.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:16:57 +0000 (11:16 +0000)]
gunixmounts: Fix a potential strcmp(NULL) call
mntent->mnt_fsname may be NULL at this point; if so, fall to the second
branch and set mount_entry->device_path = NULL.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:12:48 +0000 (11:12 +0000)]
gcontenttype: Fix a potential NULL pointer dereference
If the initial part of the header (‘MIME-TreeMagic’) is valid, but the
following line does not start with ‘[’ (i.e. is not a valid section
line), insert_matchlet() will be called with a NULL match pointer, and
will crash with a NULL pointer dereference.
Fix this by bailing out if a valid section line isn’t encountered before
the first insert_matchlet() call (i.e. between the header line and the
first data line).
Note that this has not been tested against a real treemagic file; the
fix is purely theoretical.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:11:21 +0000 (11:11 +0000)]
gunixfdlist: Fix a potential NULL pointer dereference
In the case that (n_fds == 0 && fds == NULL), memcpy() would be called
against a NULL src pointer. Even though the number of bytes to copy is
0, avoid the possibility of a crash by only calling if fds is non-NULL.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:09:58 +0000 (11:09 +0000)]
gsocketaddress: Add an assertion to help static analysis
The static analyser will check dynamic type assertions and assume that
if they fail, the variable can either have the wrong type, or be NULL
(which is correct). The analyser doesn’t know that other constraints in
the API ensure the variable is non-NULL.
Add a non-null assertion to help the static analyser and shut it up in
this case.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:08:50 +0000 (11:08 +0000)]
gdbusserver: Fix a potential g_object_unref(NULL) call
This can happen if the hash table lookup for ‘noncefile’ fails, and
hence the first ‘goto out’ is hit, at which point resolver is still
NULL.
Found with scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Philip Withnall [Tue, 26 Nov 2013 11:07:45 +0000 (11:07 +0000)]
gcontenttype: Fix a potential g_object_unref(NULL) call
This can happen if the g_file_query_info() call fails, returning NULL.
Found with scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=113075
Chun-wei Fan [Fri, 15 Nov 2013 05:00:55 +0000 (13:00 +0800)]
gio/tests/memory-output-stream.c: Avoid an uninitialized variable
Be a little bit more careful in regards to initializing a primitive type
variable before passing it by reference, as it could have random stuff
in the variable's address depending on the CRT, such as MSVCR110.DLL,
causing random, invalid stuff being written in that address.
This will fix this test when built with Visual Studio 2012.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
Chun-wei Fan [Tue, 26 Nov 2013 10:57:04 +0000 (18:57 +0800)]
glib/tests/enviroment.c: Fix running on Windows
Don't attempt to insert environmental variables in the hash table during
the test listenv that is an empty string, as GetEnvironmentStringsW() also
returns special enviroment variables which have empty strings as their
variable names, at least on Windows 7 and 8.
https://bugzilla.gnome.org/show_bug.cgi?id=711047