Skip to content

goption: Relax assertion to avoid being broken by kdeinit5

Simon McVittie requested to merge wip/smcv/issue1923 into master

kdeinit5 overwrites argv, which in turn results in /proc/self/cmdline being overwritten. It seems that this is done in a way that does not necessarily guarantee that /proc/self/cmdline will end up NUL-terminated.

However, g_file_get_contents() is documented to fill a buffer of size len + 1, where buffer[len] == '\0', even if the file's actual contents (from buffer[0] to buffer[len-1] inclusive) did not include a NUL; so we can safely relax this assertion slightly.

Resolves: #1923 (closed) Signed-off-by: Simon McVittie smcv@collabora.com


This is untested: I don't have a KDE environment. @JamieMichelle, would you be able to rebuild GLib with this patch and test your Dolphin setup with that?

Merge request reports