glib/glib
David Zeuthen 5e6f762d61 GVariant: validate that passed string is UTF-8
As discussed with Ryan on IRC.

This check is crucial because it guarantees that
g_variant_get_string() will _always_ return valid UTF-8. Except in
cases where the programmer used unsafe API such as
g_variant_new_from_data() and setting @trusted to TRUE.

In fact, this check revealed a flaw in my polkit gdbus port

 (lt-polkitd:11632): GLib-CRITICAL **: g_variant_new_string: assertion
 `g_utf8_validate (string, len, NULL)' failed

and with this I could easily find the problem by using gdb(1) and
G_DBUS=fatal-warnings.

Without this check we'd pass the non-UTF8 string all the way to the
message bus and the bus would then disconnect us. So instead I was
seeing

  g_dbus_connection_real_closed: Remote peer vanished with error:
  Underlying GIOStream returned 0 bytes on an async read
  (g-io-error-quark, 0). Exiting.

and then SIGTERM as raised by g_dbus_connection_real_closed() and my
polkitd process would exit. This behavior is much harder to debug than
failing early (as this patch implements).

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 13:38:50 -04:00
..
glib-mirroring-tab removed all .cvsignore files. SVN doesn't need them. 2007-01-03 11:22:36 +00:00
gnulib glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
libcharset Bug 549771 – improved .gitignore for glib 2008-09-02 18:40:39 +00:00
pcre Fix a warning 2010-07-30 19:51:18 -04:00
tests Move bookmarkfile tests to the test framework 2010-08-03 10:25:54 -04:00
update-pcre glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
.gitignore move glibconfig.h to glib/ 2010-07-12 15:33:05 -04:00
abicheck.sh move glibconfig.h to glib/ 2010-07-12 15:33:05 -04:00
galloca.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
garray.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
garray.h Bug 580450 – Reference counting and boxed types for arrays 2009-04-29 11:17:23 -04:00
gasyncqueue.c Move GAsyncQueue docs inline 2010-07-10 23:56:45 -04:00
gasyncqueue.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gatomic-gcc.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gatomic.c Fix a typo 2010-07-10 23:56:45 -04:00
gatomic.h Move docs for atomic operations inline 2010-07-10 23:56:45 -04:00
gbacktrace.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gbacktrace.h Bug 553857 – gbacktrace.h requires signal.h 2008-09-26 14:33:48 +00:00
gbase64.c base64: remove unnecessary assertions 2010-07-07 22:18:47 -04:00
gbase64.h Bug 564728 Add function to decode base64 encoded data in place 2009-01-13 19:59:32 +00:00
gbitlock.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gbitlock.h gbitlock: fix gtkdoc brokenness 2010-01-30 12:32:37 -05:00
gbookmarkfile.c Don't assert too much 2010-08-03 10:25:54 -04:00
gbookmarkfile.h Fix a typo 2010-07-10 23:56:45 -04:00
gbsearcharray.h [gbsearcharray] Use malloc() instead of realloc(NULL,...) 2009-07-20 16:03:25 -04:00
gbuffer.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gbuffer.h GBuffer: very small cosmetic fix to header file 2010-03-14 15:56:18 -04:00
gcache.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gcache.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gchecksum.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gchecksum.h Add docs 2008-06-15 00:03:54 +00:00
gcompletion.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gcompletion.h Deprecate some rarely-used APIS 2010-06-23 22:32:35 -04:00
gconvert.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gconvert.h The fallback parameter to g_convert_with_fallback() should be const 2010-03-16 16:40:04 +01:00
gdataset.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gdataset.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gdatasetprivate.h Fix strict aliasing warnings and viiolations to make GLib and 2009-02-17 16:14:39 +00:00
gdate.c Add comment to g_date_set_time_val about local timezone. 2010-08-01 07:22:11 +02:00
gdate.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gdebug.h Move the compiler-dependency in the G_GNUC_INTERNAL definition from 2007-05-17 16:36:53 +00:00
gdir.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gdir.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gen-script-table.pl Bug 491554 – Update to Unicode 5.1.0 2008-04-08 02:59:05 +00:00
gen-unicode-tables.pl Apply a patch from Behdad Esfahbod to use a faster lookup table for 2005-11-04 22:27:04 +00:00
gerror.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gerror.h Make g_error_new_valist public 2009-05-23 17:52:58 +02:00
gfileutils.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gfileutils.h Bug 594034 - Add g_mkstemp_full() 2009-09-04 22:45:07 +02:00
ghash.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
ghash.h GHash: move docs from tmpl to inline comments 2010-01-28 22:36:48 -05:00
ghook.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
ghook.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
ghostutils.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
ghostutils.h Add hostname-related utilities in glib/ghostutils.h 2009-04-22 08:36:02 -04:00
gi18n-lib.h Bug 548321 – <string.h> is not included in gi18n-lib.h 2008-09-11 16:48:44 +00:00
gi18n.h Bug 548321 – <string.h> is not included in gi18n-lib.h 2008-09-11 16:48:44 +00:00
giochannel.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
giochannel.h Fix problems on 64-bit Windows. Avoid warnings, some of which indicated 2008-07-28 00:24:14 +00:00
giounix.c Annotate all custom GIO GSource using g_source_set_name 2010-07-10 20:09:34 -04:00
giowin32.c Annotate all custom GIO GSource using g_source_set_name 2010-07-10 20:09:34 -04:00
gkeyfile.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gkeyfile.h Support 64bit integers in GKeyFile 2010-05-08 21:30:27 -04:00
glib_probes.d Initial support for dtrace and systemtap 2010-05-27 14:51:41 -04:00
glib_trace.h Initial support for dtrace and systemtap 2010-05-27 14:51:41 -04:00
glib-object.h gobject: Add GBinding 2010-06-15 16:06:18 +01:00
glib.h merge GVariant 2010-02-10 11:35:01 -05:00
glib.py glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
glib.rc.in Update copyright years 2010-02-04 00:12:50 +02:00
glib.stp.in Initial support for dtrace and systemtap 2010-05-27 14:51:41 -04:00
glib.symbols glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
glibconfig.h.win32.in move glibconfig.h to glib/ 2010-07-12 15:33:05 -04:00
glibintl.h Mark glib_gettext as string translation function 2009-04-01 21:51:00 -04:00
glist.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
glist.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gmacros.h Add G_GNUC_DEPRECATED_FOR macro 2010-04-23 15:26:49 +01:00
gmain.c Move main loop docs inline 2010-07-10 23:56:45 -04:00
gmain.h Move main loop docs inline 2010-07-10 23:56:45 -04:00
gmappedfile.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gmappedfile.h GMappedFile: add refcounting, switch to GSlice 2009-06-18 15:01:18 -04:00
gmarkup.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gmarkup.h Add g_markup_context_get_user_data 2008-07-28 16:52:15 +00:00
gmem.c Bug 624968 - div by zero in g_malloc_n family 2010-07-21 16:11:35 -04:00
gmem.h trivial whitespace fix 2010-07-12 17:31:03 -04:00
gmessages.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gmessages.h Fix C++ warnings in g_error() code 2009-06-27 11:03:47 +03:00
gmirroringtable.h Bug 491554 – Update to Unicode 5.1.0 2008-04-08 02:59:05 +00:00
gnode.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gnode.h Improve some GNode docs 2010-07-08 19:26:25 -04:00
goption.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
goption.h Fix a doc typo. 2010-02-21 17:59:15 -05:00
gpattern.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gpattern.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gpoll.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gpoll.h Move main loop docs inline 2010-07-10 23:56:45 -04:00
gprimes.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gprimes.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gprintf.c Expand the g_sprintf docs 2010-07-08 19:23:42 -04:00
gprintf.h make it possible to disable single-file includes by defining 2008-03-14 19:30:38 +00:00
gprintfint.h Fix #147651, reported by Oliver Guntermann: 2004-07-21 17:51:28 +00:00
gqsort.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gqsort.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gquark.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gqueue.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gqueue.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
grand.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
grand.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gregex.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gregex.h Add API to get the compile and match flags from a GRegex 2010-05-01 13:57:11 +02:00
grel.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
grel.h Deprecate some rarely-used APIS 2010-06-23 22:32:35 -04:00
gscanner.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gscanner.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gscripttable.h Bug 491554 – Update to Unicode 5.1.0 2008-04-08 02:59:05 +00:00
gsequence.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gsequence.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gshell.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gshell.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gslice.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gslice.h Remove redudant check for direct #include gslice.h 2010-02-22 00:35:45 -05:00
gslist.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gslist.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gspawn-win32-helper.c glib/giowin32.c glib/gmain.c glib/gspawn-win32.c Change gssize casts 2008-08-04 18:46:59 +00:00
gspawn-win32.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gspawn.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gspawn.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gstdio.c Fix some glib docs warnings 2010-07-12 16:56:52 -04:00
gstdio.h Fix build breakage on Unix 2010-03-30 20:46:46 +03:00
gstrfuncs.c Fix some glib docs warnings 2010-07-12 16:56:52 -04:00
gstrfuncs.h Add g_dc[p]gettext, and use it in gsettings 2010-05-20 21:16:29 +02:00
gstring.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gstring.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gtester-report Prevent division by zero if no tests 2010-06-15 02:01:16 -04:00
gtester.c gtester should fail even if -k is passed 2009-11-23 07:48:14 -06:00
gtestutils.c Fix some glib docs warnings 2010-07-12 16:56:52 -04:00
gtestutils.h Fix some glib docs warnings 2010-07-12 16:56:52 -04:00
gthread.c rename configure.in to configure.ac 2010-07-13 11:59:16 -04:00
gthread.h Clean Glib header #include issues: gthread 2010-05-06 17:42:09 +02:00
gthreadpool.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gthreadpool.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gthreadprivate.h Bug 548967 - 1 bit mutex lock 2010-01-28 12:40:46 -05:00
gtimer.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gtimer.h #define __GLIB_H_INSIDE__ around including everything. 2008-05-05 15:02:15 +00:00
gtree.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gtree.h GTree: switch to GSlice, add refcounts (#587773) 2009-07-05 12:30:54 +01:00
gtypes.h Add byteswap macros for gsize/gssize. 2009-11-30 19:53:30 -05:00
gunibreak.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gunibreak.h Bug 491554 – Update to Unicode 5.1.0 2008-04-08 02:59:05 +00:00
gunichartables.h Bug 491554 – Update to Unicode 5.1.0 2008-04-08 02:59:05 +00:00
gunicode.h Add Unicode 5.2 scripts 2010-06-20 01:14:55 -04:00
gunicodeprivate.h Make g_unichar_combining_class() public. (#453998) 2007-07-19 13:46:05 +00:00
gunicollate.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gunicomp.h Update to final Unicode Character Database 5.0.0. (#336281) 2006-07-19 22:35:17 +00:00
gunidecomp.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gunidecomp.h Update to final Unicode Character Database 5.0.0. (#336281) 2006-07-19 22:35:17 +00:00
guniprop.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gurifuncs.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gurifuncs.h don't #include <glib.h> from other public headers 2010-01-30 00:01:26 -05:00
gutf8.c Fix some glib docs warnings 2010-07-12 16:56:52 -04:00
gutils.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gutils.h Avoid compilation warning from MSVC 2010-01-05 11:32:59 +02:00
gvariant-core.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gvariant-core.h merge GVariant 2010-02-10 11:35:01 -05:00
gvariant-internal.h GVariant variable arguments, tests, cleanups 2010-03-08 10:31:19 -05:00
gvariant-parser.c Fix a typo 2010-07-31 02:07:38 -04:00
gvariant-serialiser.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gvariant-serialiser.h GVariant variable arguments, tests, cleanups 2010-03-08 10:31:19 -05:00
gvariant.c GVariant: validate that passed string is UTF-8 2010-08-03 13:38:50 -04:00
gvariant.h GVariant: improve bytestring support 2010-07-07 16:25:48 -04:00
gvarianttype.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gvarianttype.h GVariant: improve bytestring support 2010-07-07 16:25:48 -04:00
gvarianttypeinfo.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gvarianttypeinfo.h GVariant variable arguments, tests, cleanups 2010-03-08 10:31:19 -05:00
gwin32.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
gwin32.h glib/gutils.h Deprecate G_WIN32_DLLMAIN_FOR_DLL_NAME(), 2008-09-13 20:23:17 +00:00
libglib-gdb.py.in Initial support for gdb python macros 2009-09-21 15:39:00 +02:00
Makefile.am Don't add (extra) DESTDIR to tapsetdir for tapset_DATA. 2010-08-03 08:04:58 -04:00
makefile.msc.in glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00
win_iconv.c glib/: fully remove galias hacks 2010-07-07 19:34:35 -04:00