Fix crash that can occur in decode_mixed.

If a player names an object with a name that ends in '\\', drops
that object on the floor nearby and does a look at nearby objects,
then the game will crash.  This is caused by stack corruption when
the decode loop skips over the decode string terminator.
This commit is contained in:
Bart House
2019-07-02 19:08:50 -07:00
parent 1e7fb839a3
commit 25ea6c8f3c

View File

@@ -313,6 +313,15 @@ const char *str;
#endif
case '\\':
break;
case '\0':
/* String ended with '\\'. This can happen when someone
names an object with a name ending with '\\', drops the
named object on the floor nearby and does a look at all
nearby objects. */
/* brh - should we perhaps not allow things to have names
that contain '\\' */
str = save_str;
break;
}
}
*put++ = *str++;