Mercurial > hg > early-roguelike
comparison xrogue/rogue.c @ 310:827441d05b3e
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.
author | John "Elwin" Edwards |
---|---|
date | Mon, 03 May 2021 19:05:37 -0400 |
parents | 0250220d8cdd |
children |
comparison
equal
deleted
inserted
replaced
309:11aeff9acc07 | 310:827441d05b3e |
---|---|
16 See the file LICENSE.TXT for full copyright and licensing information. | 16 See the file LICENSE.TXT for full copyright and licensing information. |
17 */ | 17 */ |
18 | 18 |
19 #include <ctype.h> | 19 #include <ctype.h> |
20 #include <curses.h> | 20 #include <curses.h> |
21 #include <limits.h> | |
21 #include "rogue.h" | 22 #include "rogue.h" |
22 | 23 |
23 /* | 24 /* |
24 * Now all the global variables | 25 * Now all the global variables |
25 */ | 26 */ |
88 char *r_guess[MAXRINGS]; /* Players guess at what ring is */ | 89 char *r_guess[MAXRINGS]; /* Players guess at what ring is */ |
89 char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */ | 90 char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */ |
90 char *m_guess[MAXMM]; /* Players guess at what MM is */ | 91 char *m_guess[MAXMM]; /* Players guess at what MM is */ |
91 char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ | 92 char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ |
92 char file_name[LINELEN]; /* Save file name */ | 93 char file_name[LINELEN]; /* Save file name */ |
93 char score_file[LINELEN]; /* Score file name */ | 94 char score_file[PATH_MAX]; /* Score file name */ |
94 char home[LINELEN]; /* User's home directory */ | 95 char home[LINELEN]; /* User's home directory */ |
95 WINDOW *cw; /* Window that the player sees */ | 96 WINDOW *cw; /* Window that the player sees */ |
96 WINDOW *hw; /* Used for the help command */ | 97 WINDOW *hw; /* Used for the help command */ |
97 WINDOW *mw; /* Used to store monsters */ | 98 WINDOW *mw; /* Used to store monsters */ |
98 WINDOW *msgw; /* Used to display messages */ | 99 WINDOW *msgw; /* Used to display messages */ |