comparison arogue7/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
11 * 11 *
12 * See the file LICENSE.TXT for full copyright and licensing information. 12 * See the file LICENSE.TXT for full copyright and licensing information.
13 */ 13 */
14 14
15 #include <ctype.h> 15 #include <ctype.h>
16 #include <limits.h>
16 #include "curses.h" 17 #include "curses.h"
17 #include "rogue.h" 18 #include "rogue.h"
18 #ifdef PC7300 19 #ifdef PC7300
19 #include <sys/window.h> 20 #include <sys/window.h>
20 #endif 21 #endif
100 char *r_guess[MAXRINGS]; /* Players guess at what ring is */ 101 char *r_guess[MAXRINGS]; /* Players guess at what ring is */
101 char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */ 102 char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
102 char *m_guess[MAXMM]; /* Players guess at what MM is */ 103 char *m_guess[MAXMM]; /* Players guess at what MM is */
103 char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */ 104 char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
104 char file_name[LINELEN]; /* Save file name */ 105 char file_name[LINELEN]; /* Save file name */
105 char score_file[LINELEN]; /* Score file name */ 106 char score_file[PATH_MAX]; /* Score file name */
106 char home[LINELEN]; /* User's home directory */ 107 char home[LINELEN]; /* User's home directory */
107 WINDOW *cw; /* Window that the player sees */ 108 WINDOW *cw; /* Window that the player sees */
108 WINDOW *hw; /* Used for the help command */ 109 WINDOW *hw; /* Used for the help command */
109 WINDOW *mw; /* Used to store monsters */ 110 WINDOW *mw; /* Used to store monsters */
110 WINDOW *msgw; /* Used to display messages */ 111 WINDOW *msgw; /* Used to display messages */