freebsd-ports/games/maelstrom/files/patch-ad
Kris Kennaway 7af2e3c04d Fix an exploitable buffer overflow with the HOME environment variable.
No advisory will be released as this port is setgid games and therefore
not a security risk.
2001-01-28 23:58:41 +00:00

11 lines
353 B
Text

--- controls.cpp.orig Sun Jan 28 15:51:37 2001
+++ controls.cpp Sun Jan 28 15:51:49 2001
@@ -89,7 +89,7 @@
if ( fname ) {
*fname = datafile;
}
- sprintf(datafile, "%s/%s", home, MAELSTROM_DATA);
+ snprintf(datafile, sizeof(datafile), "%s/%s", home, MAELSTROM_DATA);
if ( (data=fopen(datafile, mode)) == NULL )
return(NULL);
return(data);