Hack for buffer overflow, should be fixed properly.

This commit is contained in:
Philip Homburg 2005-06-08 11:05:27 +00:00
parent c2cd510adf
commit d9b609c70f

View file

@ -672,7 +672,10 @@ expandmeta(str)
savelastp = exparg.lastp;
INTOFF;
if (expdir == NULL)
expdir = ckmalloc(1024); /* I hope this is big enough */
{
int i = strlen(str->text);
expdir = ckmalloc(i < 2048 ? 2048 : i); /* XXX */
}
expmeta(expdir, str->text);
ckfree(expdir);
expdir = NULL;