mirror of https://github.com/fairyglade/ly.git
Backport: Fix possible overflow with 5-digit+ UIDs
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
parent
3359127a06
commit
b7d81a9b51
|
@ -213,7 +213,7 @@ fn setXdgEnv(tty_str: [:0]u8, maybe_desktop_name: ?[:0]const u8, maybe_xdg_deskt
|
|||
// directory.
|
||||
if (builtin.os.tag != .freebsd) {
|
||||
const uid = interop.unistd.getuid();
|
||||
var uid_buffer: [10 + @sizeOf(u32) + 1]u8 = undefined;
|
||||
var uid_buffer: [32]u8 = undefined; // No UID can be larger than this
|
||||
const uid_str = try std.fmt.bufPrintZ(&uid_buffer, "/run/user/{d}", .{uid});
|
||||
|
||||
_ = interop.stdlib.setenv("XDG_RUNTIME_DIR", uid_str, 0);
|
||||
|
|
Loading…
Reference in New Issue