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:
John "Elwin" Edwards 2021-05-03 19:05:37 -04:00
parent 2b6d8bcb77
commit 3dfd8fd09b
13 changed files with 51 additions and 78 deletions

View file

@ -24,6 +24,7 @@
#include <curses.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include "rogue.h"
#define NUM_OPTS (sizeof optlist / sizeof (OPTION))
@ -524,7 +525,7 @@ get_str_prot(char *opt, WINDOW *win)
int
get_score(char *optstr, WINDOW *win)
{
char old_score_file[LINELEN];
char old_score_file[PATH_MAX];
int status;
if (use_savedir)