summaryrefslogtreecommitdiff
path: root/src/init1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:57 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:57 +0100
commitd56f3fcfdb6e166118d869290723320891c5c878 (patch)
treea013d36815a67040a48573f022db9bc255ce02a0 /src/init1.cc
parent77555000118402f6fdb86d2cd116781d0d7bd795 (diff)
init1.c: Add missing range check for a_info[] load
Diffstat (limited to 'src/init1.cc')
-rw-r--r--src/init1.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init1.cc b/src/init1.cc
index a65863b..770ae4d 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -5112,6 +5112,9 @@ errr init_a_info_txt(FILE *fp, char *buf)
/* Verify information */
if (i < error_idx) return (4);
+ /* Verify information */
+ if (i >= max_a_idx) return (2);
+
/* Save the index */
error_idx = i;