From d9b609c70f95705401aae1576fe66df554ea96f6 Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Wed, 8 Jun 2005 11:05:27 +0000 Subject: [PATCH] Hack for buffer overflow, should be fixed properly. --- commands/ash/expand.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/ash/expand.c b/commands/ash/expand.c index 8fbc82650..1b6d2a816 100755 --- a/commands/ash/expand.c +++ b/commands/ash/expand.c @@ -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; -- 2.44.0