Advanced Rogue family: fix some potential buffer overflows.
Some code for determining the score file location assumed that PATH_MAX would be less than 1024, which cannot be guaranteed. Advanced Rogue 5 and 7, and XRogue, have had the buffers for the file name enlarged. UltraRogue never called the functions, so the code has been deleted instead.
This commit is contained in:
parent
2b6d8bcb77
commit
3dfd8fd09b
13 changed files with 51 additions and 78 deletions
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <ctype.h>
|
||||
#include <curses.h>
|
||||
#include <limits.h>
|
||||
#include "rogue.h"
|
||||
|
||||
/*
|
||||
|
|
@ -90,7 +91,7 @@ char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
|
|||
char *m_guess[MAXMM]; /* Players guess at what MM is */
|
||||
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
|
||||
char file_name[LINELEN]; /* Save file name */
|
||||
char score_file[LINELEN]; /* Score file name */
|
||||
char score_file[PATH_MAX]; /* Score file name */
|
||||
char home[LINELEN]; /* User's home directory */
|
||||
WINDOW *cw; /* Window that the player sees */
|
||||
WINDOW *hw; /* Used for the help command */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue