Skip to content
  • Philip Withnall's avatar
    gkeyfilesettingsbackend: Handle long keys when converting paths · ba8ca443
    Philip Withnall authored
    
    
    Previously, the code in `convert_path()` could not handle keys longer
    than `G_MAXINT`, and would overflow if that was exceeded.
    
    Convert the code to use `gsize` and `g_memdup2()` throughout, and
    change from identifying the position of the final slash in the string
    using a signed offset `i`, to using a pointer to the character (and
    `strrchr()`). This allows the slash to be at any position in a
    `G_MAXSIZE`-long string, without sacrificing a bit of the offset for
    indicating whether a slash was found.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@endlessos.org>
    Helps: #2319
    ba8ca443