• 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
gtestutils.c 123 KB