Files
haikuports/games-arcade/tuxpuck/patches/buffer-overflow.patch
Luca D'Amico 8b042de738 Tuxpuck: add recipe (#9184)
* Tuxpuck recipe + patches
2023-08-14 13:33:15 +02:00

26 lines
738 B
Diff

From: Steve Kemp <skx@debian.org>
Date: Sat, 22 Mar 2014 16:04:16 +0100
Subject: buffer overflow
Bug: https://bugs.debian.org/203508
Forwarded: no
---
tuxpuck.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tuxpuck.c b/tuxpuck.c
index 4c0d6d7..76ecbb6 100644
--- a/tuxpuck.c
+++ b/tuxpuck.c
@@ -250,7 +250,9 @@ static void _tuxpuck_init(void)
_settings->mouse_speed = 5;
#ifndef windows
homeDir = getenv("HOME");
- sprintf(_settings_file, "%s/.tuxpuckrc", homeDir);
+ /* Buffer overflow fixed!
+ * sprintf(_settings_file, "%s/.tuxpuckrc", homeDir); */
+ snprintf(_settings_file, sizeof(_settings_file)-1, "%s/.tuxpuckrc", homeDir);
#endif
_read_settings();
audio_set_mute(!_settings->sound);