Commit Graph

16979 Commits

Author SHA1 Message Date
Bastien Nocera
bc8361262b gfileutils: Fix g_mkdtemp*() API docs
Don't refer to g_mkdtemp() when documenting g_mkdtemp_full() and
speaking about the function itself, and remove mention of flags in
aforementioned g_mkdtemp_full(), as it doesn't have such an argument
(but g_mkstemp_full() does).

https://bugzilla.gnome.org/show_bug.cgi?id=777493
2017-01-23 14:33:11 +01:00
Dušan Kazik
f3585bdfa5 Update Slovak translation 2017-01-22 21:45:51 +00:00
Piotr Drąg
8326303b9b Update Polish translation 2017-01-20 23:22:12 +01:00
Will Thompson
40cf271a77
goutputstream: docs: fix typos
"ouput" -> "output" (missing 't')
"asyncronous" -> "asynchronous" (missing 'h')

https://bugzilla.gnome.org/show_bug.cgi?id=777481
2017-01-19 08:33:58 +00:00
Daniel Mustieles
ad4347e057 Updated Spanish translation 2017-01-16 21:29:24 +01:00
Matthias Clasen
c9f731be24 2.51.1 2017-01-16 13:16:27 -05:00
Matthias Clasen
a78658be5b Pass --from-code to xgettext
It seems to require that now.
2017-01-16 13:16:27 -05:00
Philip Withnall
2c35acff7b gregex: Fix an assignment-after-free error
The match_info is freed just above this line, so this would result in a
write to freed memory.

Spotted by Leslie Zhai <xiangzhai83@gmail.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=777077
2017-01-12 09:04:39 +00:00
Philip Withnall
88e977266b gregex: Fix a potential use-after-free bug
If the match_info out argument is NULL, info will be freed, but then its
matches member will be accessed.

Spotted by Leslie Zhai <xiangzhai83@gmail.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=777077
2017-01-12 09:04:38 +00:00
Bastien Nocera
3b5b5696ed gio: Bump copy buffer size to 256k by default
This is small enough that it shouldn't cause problems on most machines
we support, but big enough to increase throughput on a lot of devices
and network protocols.

Note that the actual value is 256k minus malloc overhead, so that it
fits nicely in a 256k block (as suggested by Alexander Larsson).

See https://bugzilla.gnome.org/show_bug.cgi?id=773632

https://bugzilla.gnome.org/show_bug.cgi?id=773823
2017-01-11 18:25:21 +01:00
Bastien Nocera
0106a6cd9e gio: Use heap-allocated buffer
As if we were to increase the buffer size, it would be a bit too big to
fit on the stack.

https://bugzilla.gnome.org/show_bug.cgi?id=773823
2017-01-11 18:19:14 +01:00
Chun-wei Fan
6dfc6fee7b Visual Studio builds: Move project files to win32/
It was suggested that the project files be moved here as we don't actually
need to go two directory layers from $(srcroot), and would help us to
standardize on things in the future across the board.
2017-01-09 14:00:46 +08:00
Chun-wei Fan
b14b09c8bc Makefile.msvcproj: Document further
Mention that the *.headers are needed only if headers need to be installed
with the project/module after the build.  Also, use a generic "YourProject"
rather than the "gdk-4" project file name--I missed changing the name in the
process.
2017-01-09 12:07:42 +08:00
Chun-wei Fan
7d26e9ef93 Makefile.msvcproj: Document things a bit better
If Visual Studio 2013 or later is required, let people know how this
autotools module should be used.
2017-01-09 12:03:06 +08:00
Philip Withnall
953c182d25 gobject: Document behaviour of GType checking macros on NULL
The macros differ in their handling of NULL values — some macros ignore
them and pass through (e.g. G_TYPE_CHECK_INSTANCE_CAST) while others
will explicitly emit a warning if passed NULL (e.g.
G_TYPE_CHECK_INSTANCE).

Document their behaviour, so people don’t end up putting unnecessary
NULL checks in their code when doing checked type casts.

https://bugzilla.gnome.org/show_bug.cgi?id=735731
2017-01-07 23:43:06 +00:00
Rafael Fontenelle
c8330b80fc Update Brazilian Portuguese translation 2017-01-05 10:10:56 +00:00
Sébastien Wilmet
6231b1abc9 License headers: replace current FSF address by a link to gnu.org
Even if the address is correct, it's far more convenient to have a link
to a website.

https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:57 +01:00
Sébastien Wilmet
46c0c5cd85 License headers: replace old FSF address by a link to gnu.org
https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:57 +01:00
Sébastien Wilmet
f60590534d License headers: "the Gnome Library" -> "this library"
Harmonize a little the license headers. In most of the license headers
in GLib, it is "this library".

It is also what is explained at:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html#SEC4
"How to Apply These Terms to Your New Libraries"

https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:56 +01:00
Sébastien Wilmet
8edcf67b02 License headers: "GLib" -> "This library"
Harmonize a little the license headers. In most of the license headers
in GLib, it is "This library".

It is also what is explained at:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html#SEC4
"How to Apply These Terms to Your New Libraries"

https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:56 +01:00
Sébastien Wilmet
e603035d13 License headers: "The GLib Library" -> "This library"
Harmonize a little the license headers. In most of the license headers
in GLib, it is "This library".

It is also what is explained at:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html#SEC4
"How to Apply These Terms to Your New Libraries"

https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:56 +01:00
Christian Hergert
83d6c38e0c subprocess: avoid infinite loop in verify_disposition()
When performing the verify and building the error string there were two
possibilities of an infinite loop. The first is the missing twos-complement
to unset the bit in the filtered flags. The second is the lack of handling
G_SUBPROCESS_FLAGS_NONE which can return a valid GFlagsValue (and cannot
unset the bit since the value is zero).

This walks all known values in the GSubprocessFlags type class and check
if they are set. This has the benefit that we don't call needless functions
which walk the same table as well as avoiding mutating values to build
the error string.

https://bugzilla.gnome.org/show_bug.cgi?id=775913
2017-01-03 15:49:05 -08:00
Bastien Nocera
2e26893bf8 resolver: Fix compilation
Problem introduced in commit 442b7ce.
2017-01-03 16:26:38 +01:00
Bastien Nocera
442b7ce899 resolver: Return error looking up invalid hostnames
Make g_resolver_lookup_by_name() and g_resolver_lookup_by_name_async()
error out when invalid hostnames are passed.

https://bugzilla.gnome.org/show_bug.cgi?id=772989
2017-01-03 14:35:52 +01:00
Bastien Nocera
5c566e435e httpproxy: Fix invalid request on invalid hostnames
When an invalid hostname is passed for connection, the
g_hostname_to_ascii() might fail when creating the request in
create_request(). Make sure that error is caught and reported rather
than passing "(null)" as the hostname of the site we want to connect to.

https://bugzilla.gnome.org/show_bug.cgi?id=772989
2017-01-03 14:35:52 +01:00
Shawn Walker
9b3cb4470d Remove stray semicolon after g_variant_print() function in gvariant.c
https://bugzilla.gnome.org/show_bug.cgi?id=776198

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-12-27 20:49:42 +01:00
Sjoerd Simons
e097619327 Assert threads are created in test 642026
We kept seeing the glib testsuite hanging on our CI system in the
testcase for 642026. After some digging it turned out the jenkins slave
was misconfigured and its task limit was too low.

Add an assertion that the test thread has been created to more easily
spot this error condition as opposed to the test simply hanging.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=769672
2016-12-27 20:43:17 +01:00
Ingo Brückl
731e7fea17 tests: Don't run tests requiring DBUS unconditionally
The tests defaultvalue, gdbus-peer and gdbus-unix-addresses will fail
without DBUS, so only run them in case we HAVE_DBUS_DAEMON.

Signed-off-by: Ingo Brückl <ib@wupperonline.de>

https://bugzilla.gnome.org/show_bug.cgi?id=767609
2016-12-27 20:13:46 +01:00
Fran Dieguez
7ff42a4003 Updated Galician translations 2016-12-27 00:35:18 +01:00
Chun-wei Fan
c5754bdc43 build/Makefile.msvcproj: Fix cleanup
When we make Visual Studio 2013 the baseline Visual Studio version, we need to
the *.vs12.sourcefiles that are generated along the way so that 'make distcheck'
won't complain about the leftover files.  This was not caught in GLib as we do
not yet require Visual Studio 2013, but we update this here as this module is
intended to be used in projects that support Visual Studio project builds.
2016-12-20 14:36:02 +08:00
Marek Černocký
073f4dfb88 Updated Czech translation 2016-12-18 23:59:07 +01:00
Yosef Or Boczko
6c293d0af4 Updated Hebrew translation 2016-12-11 07:14:58 +02:00
Chun-wei Fan
7518067cec gmessages.c: Windows: Improve g_log_writer_supports_colors()
... when tty terminal emulators (such as mintty) are used.  This support
is however for Vista and later, so use of such terminals should have
support for ANSI color codes in their outputs, even on Windows 7/8/8.1/

https://bugzilla.gnome.org/show_bug.cgi?id=775468
2016-12-08 22:15:47 +08:00
Baurzhan Muftakhidinov
1ef807445c Update Kazakh translation 2016-12-08 10:06:39 +00:00
donadigo
ab70359bbf Fixed notify id in FDO notification backend
https://bugzilla.gnome.org/show_bug.cgi?id=775765
2016-12-07 12:39:25 -08:00
Ignacio Casal Quinteiro
4b98a79997 gioerror: make WSAESHUTDOWN an alias of G_IO_ERROR_CONNECTION_CLOSED
This fixes one of the assertions of the socket unit tests where
G_IO_ERROR_FAILED was returned instead of G_IO_ERROR_CONNECTION_CLOSED.
2016-12-07 08:47:00 +01:00
Sebastian Dröge
799f8dcd46 GSocket: Fix race conditions on Win32 if multiple threads are waiting on conditions for the same socket
WSAWaitForMultipleEvents() only returns for one of the waiting threads, and
that one might not even be the one waiting for the condition that changed. As
such, only let a single thread wait on the event and use a GCond for all other
threads.

With this it is possible to e.g. have an UDP socket that is written to from
one thread and read from in another thread on Win32 too. On POSIX systems this
was working before already.

https://bugzilla.gnome.org/show_bug.cgi?id=762283
2016-12-05 18:17:17 +02:00
Sebastian Dröge
620b3c1e56 gmessages: Fix compilation on Android
There is no systemd on Android.

https://bugzilla.gnome.org/show_bug.cgi?id=775621
2016-12-05 12:12:50 +02:00
Chun-wei Fan
7a61a94b95 gmessages.c/Windows: Improve g_log_writer_supports_color()
Windows 10 begins to support color output on the console using ANSI
codes, but a few extra steps are required for this support, so we cannot
just use isatty() and expect colors to work in the outputs.
Instead, we use still use isatty() from the Windows CRT, and then enable
ENABLE_VIRTUAL_TERMINAL_PROCESSING if it returns true.

Also make the invalid parameter handler shared between gmessages.c and
gspawn-win32-helper.c, since it is basically intended to be a no-op stub.

https://bugzilla.gnome.org/show_bug.cgi?id=775468
2016-12-05 16:47:09 +08:00
Simon McVittie
0d28ee458f type-test: do not rely on signed integer overflow wrapping around
Signed integer overflow is undefined behaviour: if a compiler
detects signed integer overflow, it is free to compile it to absolutely
anything.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:47 +00:00
Simon McVittie
4496ef91b5 g_hostname_is_ip_address: detect integer overflow
Signed integer overflow is undefined behaviour, which the undefined
behaviour sanitizer detects.

Previously, if the compiler had implemented this in the obvious way
(overflowing signed multiplication wraps around mod 2**32), we would
have incorrectly classified addresses where one octet was, for example,
(2**32 + 42) as valid IP addresses, by treating that octet as though
it was 42.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:45 +00:00
Simon McVittie
1d697a5f30 g_unichar_iswide_cjk: add a special case for U+0000
bsearch() is defined to search for a non-null key, so we can't
search for NULL. The undefined behaviour sanitizer picks this up.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:44 +00:00
Simon McVittie
663e12feca gdbus-serialization test: don't left-shift a negative number
-2LL<<34 is undefined, because left-shifting a negative number is
undefined (it was implementation-defined behaviour in C99, but
is formally undefined in C11). The undefined behaviour sanitizer
picks this up.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:41 +00:00
Simon McVittie
e5ed410c8c Avoid calling Standard C string/array functions with NULL arguments
glibc string.h declares memcpy() with attribute(nonnull(1,2)), causing
calls with NULL arguments to be treated as undefined behaviour.
This is consistent with ISO C99 and C11, which state that passing 0
to string functions as an array length does not remove the requirement
that the pointer to the array is a valid pointer.
gcc -fsanitize=undefined catches this while running OSTree's test suite.

Similarly, running the GLib test suite reports similar issues for
qsort(), memmove(), memcmp().

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:39 +00:00
Simon McVittie
5e7eaaaaee GParam: make G_PARAM_USER_MASK unsigned
UBSan considers left-shifting a negative number to be undefined
behaviour (per
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_081.html> it is
implementation-defined in C89, but according to
<https://llvm.org/bugs/show_bug.cgi?id=17490> it is undefined in C99).

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:26 +00:00
Ondrej Holy
d1d1aba3b4 Add missing check for termios.h
Check for termios.h is missing and passwords in the new gio tool
are echoed in the terminal consequently, which is really bad!

https://bugzilla.gnome.org/show_bug.cgi?id=775517
2016-12-02 13:25:12 +01:00
Ignacio Casal Quinteiro
463a863605 gdbusauth: fix crash when server data send returns NULL
_g_dbus_auth_mechanism_server_data_send may fail in which case
we would endup getting a NULL data. In this case we should not
try to encode the data and simply let the state machine to continue.
The auth mechanism will change internally to REJECTED so we just
need to continue the iteration.

https://bugzilla.gnome.org/show_bug.cgi?id=775309
2016-11-29 13:12:47 +01:00
Ignacio Casal Quinteiro
93179f10b8 dbusaddress: do not leak error on win32 code 2016-11-29 09:21:04 +01:00
Philip Withnall
3e7b5cbef8 glib: Namespace global tapset variables by soname
global variables in SystemTap are shared between all SystemTap scripts;
so if scripts are loaded for two versions of GLib (for example, a stable
and a development version), those global variables will conflict.

Avoid that by including the soname’s version in the global variable
names.

https://bugzilla.gnome.org/show_bug.cgi?id=770646
2016-11-23 10:50:39 +00:00
Philip Withnall
a24f57b071 glib: Add installed Valgrind suppressions file for GLib and GIO
While we cannot get Valgrind to automatically load this suppression file
for applications which link to GLib
(https://bugs.kde.org/show_bug.cgi?id=160905), we can at least install
it on systems in a shared directory, so that developers can use a
standardised (and up-to-date) suppressions file for GLib, rather than
rolling their own.

The file will typically be installed to:
   /usr/share/glib-2.0/valgrind/glib.supp

Distributors: it is recommended that this suppression file be installed
as part of the development package for GLib in your distribution.

https://bugzilla.gnome.org/show_bug.cgi?id=666114
2016-11-23 10:45:56 +00:00