Open installgentoo opened 3 days ago
Could you create a PR for this patch?
ironic that the safety measure itself caused a bug
Could you give more details? I don't see how unique_ptr
wrapper gives nondescript error.
@qarkai
appending ".tmp_XXXXXX" to filename extends the filename length past 255 characters.
@qarkai
appending ".tmp_XXXXXX" to filename extends the filename length past 255 characters.
So IIUC any g_strconcat
and g_build_filename
is dangerous. Also it has nothing to do with memory safety.
@caclark should we apply wrapper from patch to all relevant g_strconcat
and g_build_filename
code?
@qarkai is there any other code that appends arbitrary strings to filenames?
If so i would think my check+truncate approach should be a function and used everywhere.
@qarkai is there any other code that appends arbitrary strings to filenames?
If so i would think my check+truncate approach should be a function and used everywhere.
Proposed patch looks like overengineering. Should be enough randname = g_build_filename(tl_dirname, ".tmp_XXXXXX", NULL);
.
Again, could you create PR? Note that unique_ptr was replaced with g_auto* macros.
@installgentoo Is it related to #944?
@qarkai must be. Please write PR or whatever and close that other bug.
Setup (please complete the following information):
Describe the bug Ditto.
To reproduce Name a file with 255 characters, try to copy it. Get a nondescript error.
Additional context This happens because of
at src/ui-fileops.cc:648
I assume this is meant to safeguard against partial operations that get interrupted, ironic that the safety measure itself caused a bug. See attached patch with a fix, refactor it into geeqie code standard and merge in. filenamelen.patch