Fix possible lev_comp segfault when map was too tall
This commit is contained in:
@@ -102,6 +102,7 @@ make vault guard accept names starting with number
|
|||||||
fix weight of containers in special levels
|
fix weight of containers in special levels
|
||||||
allow knife and stiletto as possible tin opening tools
|
allow knife and stiletto as possible tin opening tools
|
||||||
make the raven medusa level shortsighted
|
make the raven medusa level shortsighted
|
||||||
|
fix possible segfault in lev_comp when map was too tall
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+3
-1
@@ -1351,7 +1351,7 @@ sp_lev *sp;
|
|||||||
register char *s1, *s2;
|
register char *s1, *s2;
|
||||||
int max_len = 0;
|
int max_len = 0;
|
||||||
int max_hig = 0;
|
int max_hig = 0;
|
||||||
char *tmpmap[ROWNO];
|
char *tmpmap[MAP_Y_LIM+1];
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
char *mbuf;
|
char *mbuf;
|
||||||
|
|
||||||
@@ -1378,6 +1378,8 @@ sp_lev *sp;
|
|||||||
|
|
||||||
/* Then parse it now */
|
/* Then parse it now */
|
||||||
while (map && *map) {
|
while (map && *map) {
|
||||||
|
if (max_hig > MAP_Y_LIM)
|
||||||
|
break;
|
||||||
tmpmap[max_hig] = (char *) alloc(max_len);
|
tmpmap[max_hig] = (char *) alloc(max_len);
|
||||||
s1 = index(map, '\n');
|
s1 = index(map, '\n');
|
||||||
if (s1) {
|
if (s1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user