pr_edict.c (PR_ValueString, PR_UglyValueString, PR_GlobalString,

PR_GlobalStringNoContents): increase static line buffer size to
512, so that excessively long global strings don't cause a crash.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@791 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2012-12-11 10:11:22 +00:00
parent 94c91375b0
commit 99566f0991

View file

@ -307,7 +307,7 @@ Returns a string describing *data in a type specific manner
*/ */
static const char *PR_ValueString (int type, eval_t *val) static const char *PR_ValueString (int type, eval_t *val)
{ {
static char line[256]; static char line[512];
ddef_t *def; ddef_t *def;
dfunction_t *f; dfunction_t *f;
@ -360,7 +360,7 @@ Easier to parse than PR_ValueString
*/ */
static const char *PR_UglyValueString (int type, eval_t *val) static const char *PR_UglyValueString (int type, eval_t *val)
{ {
static char line[256]; static char line[512];
ddef_t *def; ddef_t *def;
dfunction_t *f; dfunction_t *f;
@ -409,11 +409,11 @@ padded to 20 field width
*/ */
const char *PR_GlobalString (int ofs) const char *PR_GlobalString (int ofs)
{ {
static char line[512];
const char *s; const char *s;
int i; int i;
ddef_t *def; ddef_t *def;
void *val; void *val;
static char line[128];
val = (void *)&pr_globals[ofs]; val = (void *)&pr_globals[ofs];
def = ED_GlobalAtOfs(ofs); def = ED_GlobalAtOfs(ofs);
@ -435,9 +435,9 @@ const char *PR_GlobalString (int ofs)
const char *PR_GlobalStringNoContents (int ofs) const char *PR_GlobalStringNoContents (int ofs)
{ {
static char line[512];
int i; int i;
ddef_t *def; ddef_t *def;
static char line[128];
def = ED_GlobalAtOfs(ofs); def = ED_GlobalAtOfs(ofs);
if (!def) if (!def)