file: Provide EF_WITH_CADEF_MAX_ENTRY_SIZE to clean up xditem()
xditem() needs a buffer that can hold entries of any xdumpable table. It's been 2048 bytes and marked FIXME since day one. Clean it up so that if anyone ever goes crazy with entry sizes, we fail an assertion during startup instead of overrunning the buffer during play. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
9ef4f1bf50
commit
9a6998882a
3 changed files with 16 additions and 4 deletions
|
@ -27,7 +27,7 @@
|
|||
* xdump.c: Extended dump
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Markus Armbruster, 2004-2011
|
||||
* Markus Armbruster, 2004-2014
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -140,7 +140,7 @@ xditem(struct xdstr *xd, int type, char *arg)
|
|||
struct castr *ca;
|
||||
struct nstr_item ni;
|
||||
int n;
|
||||
char buf[2048]; /* FIXME buffer size? */
|
||||
unsigned char buf[EF_WITH_CADEF_MAX_ENTRY_SIZE];
|
||||
|
||||
ca = ef_cadef(type);
|
||||
if (!ca)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue