summaryrefslogtreecommitdiffstats
path: root/rogue/rogue.h
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2002-10-01 14:18:57 +0000
committermrg <mrg@NetBSD.org>2002-10-01 14:18:57 +0000
commita07de2b816b2a6d7b25bffefd1239db80d85f6d7 (patch)
tree06062ea06a61f0b7694f7d9fc038ab912c9f3a9e /rogue/rogue.h
parente0b92fed06e8d627affa09e5138e4ccef985b6ad (diff)
downloadbsdgames-darwin-a07de2b816b2a6d7b25bffefd1239db80d85f6d7.tar.gz
bsdgames-darwin-a07de2b816b2a6d7b25bffefd1239db80d85f6d7.tar.zst
bsdgames-darwin-a07de2b816b2a6d7b25bffefd1239db80d85f6d7.zip
- use correctly bounded strings when reloading a saved game. in particular,
do not let the save game file "string length" exceed the amount of space supplied. as noted by <stanojr@iserver.sk> on bugtraq. - minor KNF. tested by simonb.
Diffstat (limited to 'rogue/rogue.h')
-rw-r--r--rogue/rogue.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/rogue/rogue.h b/rogue/rogue.h
index ec67cc76..67d104a5 100644
--- a/rogue/rogue.h
+++ b/rogue/rogue.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rogue.h,v 1.12 2001/02/05 01:04:25 christos Exp $ */
+/* $NetBSD: rogue.h,v 1.13 2002/10/01 14:18:57 mrg Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -192,9 +192,10 @@
#define MAX_OPT_LEN 40
+#define MAX_ID_TITLE_LEN 64
struct id {
short value;
- char *title;
+ char title[MAX_ID_TITLE_LEN];
char *real;
unsigned short id_status;
};
@@ -658,7 +659,7 @@ int rand_percent __P((int));
void rand_place __P((object *));
void read_pack __P((object *, FILE *, boolean));
void read_scroll __P((void));
-void read_string __P((char *, FILE *));
+void read_string __P((char *, FILE *, size_t));
void recursive_deadend __P((short, const short *, short, short));
boolean reg_move __P((void));
void relight __P((void));
@@ -763,8 +764,9 @@ extern boolean sustain_strength;
extern boolean trap_door;
extern boolean wizard;
extern char hit_message[];
-extern char hunger_str[];
-extern char login_name[];
+#define HUNGER_STR_LEN 8
+extern char hunger_str[HUNGER_STR_LEN];
+extern char login_name[MAX_OPT_LEN];
extern const char *byebye_string;
extern const char *curse_message;
extern const char *error_file;