Skip to content
  • Philip Withnall's avatar
    d0c9c080
    gbytes: Squash data to `NULL` if length is zero · d0c9c080
    Philip Withnall authored
    
    
    This used to happen consistently before !4290, but that MR changed it so
    that `data` could be non-`NULL` if `size == 0` if the new inline code
    path is taken.
    
    While users of `GBytes` shouldn’t be dereferencing the data if the
    bytes’ length is zero, it’s definitely safer to make sure the data is
    `NULL` in that case.
    
    This shouldn’t break the expectations of any third party code because
    it’s restoring the behaviour from before !4290.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    
    Fixes: #3562
    d0c9c080
    gbytes: Squash data to `NULL` if length is zero
    Philip Withnall authored
    
    
    This used to happen consistently before !4290, but that MR changed it so
    that `data` could be non-`NULL` if `size == 0` if the new inline code
    path is taken.
    
    While users of `GBytes` shouldn’t be dereferencing the data if the
    bytes’ length is zero, it’s definitely safer to make sure the data is
    `NULL` in that case.
    
    This shouldn’t break the expectations of any third party code because
    it’s restoring the behaviour from before !4290.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    
    Fixes: #3562
Loading