• Philip Withnall's avatar
    gkeyfilesettingsbackend: Handle long keys when converting paths · 7781a9cb
    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: Philip Withnall's avatarPhilip Withnall <pwithnall@endlessos.org>
    Helps: #2319
    7781a9cb
gkeyfilesettingsbackend.c 30.4 KB