1. 07 Jan, 2019 1 commit
    • Philip Withnall's avatar
      gthread: Add g_private_set_alloc0() internal convenience API · f6caeb6d
      Philip Withnall authored
      This is a wrapper around g_private_set() which allocates the desired
      amount of memory for the caller and calls g_private_set() on it.
      
      This is intended to make it easier to suppress Valgrind warnings about
      leaked memory, since g_private_set() is typically used to make one-time
      per-thread allocations. We can now just add a blanket suppression rule
      for any allocations inside g_private_set_alloc0().
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      f6caeb6d
  2. 04 Sep, 2018 1 commit
  3. 13 Feb, 2018 1 commit
  4. 09 Feb, 2018 2 commits
  5. 02 Feb, 2018 3 commits
  6. 19 Jan, 2018 3 commits
    • Mikhail Zabaluev's avatar
      gconvert: Consistently validate inputs and outputs for embedded NULs · f35a6a70
      Mikhail Zabaluev authored
      String inputs to convenience conversion functions g_locale_from_utf8(),
      g_filename_from_utf8(), and g_filename_to_utf8(), are annotated for the
      bindings as NUL-terminated strings of (type utf8) or (type filename).
      There is also a len parameter that allows converting part of the string,
      but it is exposed to the bindings as a value independent from the string
      buffer. Absent any more sophisticated ways to annotate, the way to
      provide a safeguard against len argument values longer than the
      string length is to check that no nul is encountered within the first
      len bytes of the string. strdup_len() includes this check as part of
      UTF-8 validation, but g_convert() permits embedded nuls.
      
      For g_filename_from_utf8(), also check the output to prevent embedded NUL
      bytes. It's not safe to allow embedded NULs in a string that is going
      to be used as (type filename), and no known bytestring encoding for
      file names allows them.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=792516
      f35a6a70
    • Mikhail Zabaluev's avatar
      gconvert: Tighten, document embedded NUL behavior of UTF-8 conversions · 81cd8154
      Mikhail Zabaluev authored
      The character encoding conversion utility functions g_locale_to_utf8()
      and g_filename_to_utf8() had inconsistent behavior on producing strings
      with inner NUL bytes: in the all-UTF-8 strdup path, the input string
      validation prohibits embedded NULs, while g_convert(), using iconv(),
      can produce UTF-8 output with NUL bytes inside the output buffer.
      This, while valid UTF-8 per the Unicode standard, is not valid for
      the nul-terminated (type utf8) return value format that the *_to_utf8()
      functions are annotated with (as per discussion in bug 756128).
      
      Check the output of g_convert() for embedded NUL bytes, and if any
      are found, set the newly introduced error
      G_CONVERT_ERROR_EMBEDDED_NUL.
      
      Also document the error set by g_{locale,filename}_{from,to}_utf8()
      when the input string contains nul bytes.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=792516
      81cd8154
    • Mikhail Zabaluev's avatar
      gconvert: Optimize UTF-8 conversions, fix output on error · 413605a6
      Mikhail Zabaluev authored
      In the strdup_len() path, no need to do what g_utf8_validate()
      already does: locate the string-terminating nul byte.
      
      Also in strdup_len(), make the out parameter bytes_read receive the length
      of the valid (meaning also nul-free) part of the input string, as the
      documentation on g_{locale,filename}_{from,to}_utf8() says it does.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=792516
      413605a6
  7. 11 Jan, 2018 1 commit
  8. 12 Nov, 2017 1 commit
  9. 11 Sep, 2017 1 commit
  10. 24 May, 2017 1 commit
    • Sébastien Wilmet's avatar
      glib/: LGPLv2+ -> LGPLv2.1+ · f9faac76
      Sébastien Wilmet authored
      All glib/*.{c,h} files have been processed, as well as gtester-report.
      
      12 of those files are not licensed under LGPL:
      
      	gbsearcharray.h
      	gconstructor.h
      	glibintl.h
      	gmirroringtable.h
      	gscripttable.h
      	gtranslit-data.h
      	gunibreak.h
      	gunichartables.h
      	gunicomp.h
      	gunidecomp.h
      	valgrind.h
      	win_iconv.c
      
      Some of them are generated files, some are licensed under a BSD-style
      license and win_iconv.c is in the public domain.
      
      Sub-directories inside glib/:
      
      	deprecated/: processed in a previous commit
      	glib-mirroring-tab/: already LGPLv2.1+
      	gnulib/: not modified, the code is copied from gnulib
      	libcharset/: a copy
      	pcre/: a copy
      	tests/: processed in a previous commit
      
      https://bugzilla.gnome.org/show_bug.cgi?id=776504
      f9faac76
  11. 28 Apr, 2017 1 commit
    • Philip Withnall's avatar
      docs: Fix (nullable) (optional) annotations · b63469d7
      Philip Withnall authored
      There are a few places where commit 18a33f72 replaced valid (nullable)
      (optional) annotations with just (optional). That has a different
      meaning.
      
      (nullable) (optional) can only be applied to gpointer* parameters, and
      means that both the gpointer* and returned gpointer can be NULL. i.e.
      The caller can pass in NULL to ignore the return value; and the returned
      value can be NULL.
      
      (optional) can be applied to anything* parameters, and means that the
      anything* can be NULL. i.e. The caller can pass in NULL to ignore the
      return value. The return value cannot be NULL.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      b63469d7
  12. 06 Apr, 2017 1 commit
  13. 02 Mar, 2017 1 commit
    • Paolo Borelli's avatar
      Make g_utf8_make_valid optionally take a length · f559bc01
      Paolo Borelli authored
      g_utf8_make_valid was turned into a public API this cycle. However
      now that it is public we should make the API more generic, allowing
      the caller to specify the length. This is especially useful if
      the function is called with a string that has \0 in the middle
      or for chunks of a strings that are not nul terminated.
      This is also consistent with most of the other utf8 utils.
      
      Callers inside glib are updated to the new signature.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=779456
      f559bc01
  14. 22 Nov, 2016 1 commit
  15. 13 Oct, 2016 1 commit
  16. 12 Oct, 2016 1 commit
  17. 04 Jun, 2016 1 commit
  18. 12 Apr, 2016 1 commit
  19. 07 Nov, 2015 1 commit
    • Philip Withnall's avatar
      glib: Add missing (nullable) and (optional) annotations · 25a7c817
      Philip Withnall authored
      Add various (nullable) and (optional) annotations which were missing
      from a variety of functions. Also port a couple of existing (allow-none)
      annotations in the same files to use (nullable) and (optional) as
      appropriate instead.
      
      Secondly, add various (not nullable) annotations as needed by the new
      default in gobject-introspection of marking gpointers as (nullable). See
      https://bugzilla.gnome.org/show_bug.cgi?id=729660.
      
      This includes adding some stub documentation comments for the
      assertion macro error functions, which weren’t previously documented.
      The new comments are purely to allow for annotations, and hence are
      marked as (skip) to prevent the symbols appearing in the GIR file.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=719966
      25a7c817
  20. 30 May, 2014 1 commit
  21. 20 Feb, 2014 2 commits
  22. 08 Feb, 2014 2 commits
  23. 06 Feb, 2014 4 commits
  24. 01 Feb, 2014 4 commits
  25. 31 Jan, 2014 1 commit
  26. 19 Oct, 2013 2 commits