1. 04 Feb, 2021 1 commit
    • Philip Withnall's avatar
      glib: Use g_memdup2() instead of g_memdup() in obvious places · 0736b7c1
      Philip Withnall authored
      
      
      Convert all the call sites which use `g_memdup()`’s length argument
      trivially (for example, by passing a `sizeof()` or an existing `gsize`
      variable), so that they use `g_memdup2()` instead.
      
      In almost all of these cases the use of `g_memdup()` would not have
      caused problems, but it will soon be deprecated, so best port away from
      it
      
      In particular, this fixes an overflow within `g_bytes_new()`, identified
      as GHSL-2021-045 by GHSL team member Kevin Backhouse.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <pwithnall@endlessos.org>
      Fixes: GHSL-2021-045
      Helps: #2319
      0736b7c1
  2. 04 Nov, 2019 1 commit
    • Simon McVittie's avatar
      gbytes: Avoid memcmp (NULL, ., 0) or memcmp (., NULL, 0) · 8235bbe4
      Simon McVittie authored
      Similar to 3837b83f
      
      , glibc memcmp is declared with the first two
      arguments annotated as non-null via an attribute, which results in the
      undefined behaviour sanitizer considering it to be UB to pass a null
      pointer there (even if we are comparing 0 bytes, and hence not actually
      dereferencing the pointer).
      
      This shows up in /gvariant/serialiser/children when run with the
      undefined behaviour sanitizer.
      Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
      8235bbe4
  3. 06 Aug, 2018 1 commit
  4. 11 Jun, 2018 1 commit
  5. 27 Jan, 2018 2 commits
  6. 07 Dec, 2017 1 commit
  7. 12 Nov, 2017 1 commit
  8. 06 Oct, 2017 1 commit
  9. 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
  10. 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
  11. 02 Oct, 2015 2 commits
  12. 14 Jul, 2014 1 commit
  13. 31 Jan, 2014 1 commit
  14. 27 Nov, 2013 1 commit
  15. 09 Nov, 2012 1 commit
    • Martin Pitt's avatar
      GBytes: Add missing annotations · e06268d7
      Martin Pitt authored
      Annotate g_bytes_new*()'s data argument to be a guint8 array, as
      introspection clients cannot deal with raw gconstpointers. This makes
      GBytes' behaviour similar to GByteArray whose API already uses guint8.
      
      Add missing transfer annotation to g_bytes_get_data() to make it
      introspectable.
      
      This is covered by test cases in PyGObject.
      e06268d7
  16. 17 Oct, 2012 1 commit
  17. 15 Dec, 2011 1 commit
  18. 24 Nov, 2011 1 commit
    • Stef Walter's avatar
      GBytes: A new type for an immutable set of bytes. · fcc69fd3
      Stef Walter authored
       * Represents an immutable reference counted block of memory.
       * This is basically the internal glib GBuffer structure exposed,
         renamed, and with some additional capabilities.
       * The GBytes name comes from python3's immutable 'bytes' type
       * GBytes can be safely used as keys in hash tables, and have
         functions for doing so: g_bytes_hash, g_bytes_equal
       * GByteArray is a mutable form of GBytes, and vice versa. There
         are functions for converting from one to the other efficiently:
         g_bytes_unref_to_array() and g_byte_array_free_to_bytes()
       * Adds g_byte_array_new_take() to support above functions
      
      https://bugzilla.gnome.org/show_bug.cgi?id=663291
      fcc69fd3