Check ef_type before dereferencing struct empobj
Such manual checking is error prone, but the best we can do right now.
This commit is contained in:
parent
990b39edec
commit
5490782db3
7 changed files with 52 additions and 9 deletions
|
@ -67,6 +67,9 @@ do_look(short type)
|
|||
unsigned char *bitmap;
|
||||
int changed = 0;
|
||||
|
||||
if (CANT_HAPPEN(type != EF_LAND && type != EF_SHIP))
|
||||
type = EF_SHIP;
|
||||
|
||||
if (!snxtitem(&ni, type, player->argp[1]))
|
||||
return RET_SYN;
|
||||
if ((bitmap = malloc((WORLD_X * WORLD_Y) / 8)) == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue