1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00
freebsd-ports/games/0verkill/files/patch-client.c
Michael Landin 2dac7afb6a 1. Merge fixes for long known bugs from hackndev[1] version
3507529 64bit fix ... now works on amd64 as well ;-)
95d2af2 Replaced all those insecure sprintf's with snprintf's (partial)
33a1a8d Fix sigsegv on hero reaching topmost or leftmost border of the game area
436bbfc Push back network stack underflow bugfix
160e4d6 Prevent buffer overflow
ee911ba make the server invulnerable to long names
2. Add patch from gentoo linux[2] to use unmodified game data.
3. Support staging
4. Use options framework

[1] https://github.com/hackndev/0verkill
[2] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/games-action/0verkill/files/0verkill-0.16-gentoo-paths.patch?revision=1.1&view=markup

PR:		ports/184252
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2013-12-23 16:32:05 +00:00

27 lines
725 B
C

--- client.c.orig 2001-12-16 12:26:38.000000000 +0300
+++ client.c 2013-11-17 11:40:44.755218781 +0400
@@ -191,9 +191,9 @@
unsigned char txt[256];
#ifndef WIN32
- sprintf(txt,"%s/%s",getenv("HOME"),CFG_FILE);
+ snprintf(txt,sizeof(txt),"%s/%s",getenv("HOME"),CFG_FILE);
#else
- sprintf(txt,"./%s",CFG_FILE);
+ snprintf(txt,sizeof(txt),"./%s",CFG_FILE);
#endif
stream=fopen(txt,"r");
if (!stream)return;
@@ -223,9 +223,9 @@
unsigned char txt[256];
#ifndef WIN32
- sprintf(txt,"%s/%s",getenv("HOME"),CFG_FILE);
+ snprintf(txt,sizeof(txt),"%s/%s",getenv("HOME"),CFG_FILE);
#else
- sprintf(txt,"./%s",CFG_FILE);
+ snprintf(txt,sizeof(txt),"./%s",CFG_FILE);
#endif
stream=fopen(txt,"w");
if (!stream)return;