Backport: Fix possible overflow with TTY ID

Co-authored-by: Kevin Morris <kevr@0cost.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2024-07-27 21:07:41 +02:00
parent a807e8e11c
commit 10cd9615ef
No known key found for this signature in database
GPG Key ID: 3E85EB44F610AD7F
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ pub fn sessionSignalHandler(i: c_int) callconv(.C) void {
} }
pub fn authenticate(config: Config, current_environment: Desktop.Environment, login: [:0]const u8, password: [:0]const u8) !void { pub fn authenticate(config: Config, current_environment: Desktop.Environment, login: [:0]const u8, password: [:0]const u8) !void {
var tty_buffer: [2]u8 = undefined; var tty_buffer: [3]u8 = undefined;
const tty_str = try std.fmt.bufPrintZ(&tty_buffer, "{d}", .{config.tty}); const tty_str = try std.fmt.bufPrintZ(&tty_buffer, "{d}", .{config.tty});
// Set the XDG environment variables // Set the XDG environment variables