From 1d5ec10659d67020c5b709e4df4c49bc0d59d58c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karel=20Kl=C3=AD=C4=8D?= Date: Mon, 25 Oct 2010 12:48:36 +0100 Subject: [PATCH] fish: Fix too-short allocation in tilde expansion (RHBZ#636061). --- fish/tilde.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish/tilde.c b/fish/tilde.c index c599e16..83aa70d 100644 --- a/fish/tilde.c +++ b/fish/tilde.c @@ -85,7 +85,7 @@ expand_home (const char *append) home = getenv ("HOME"); if (!home) home = "~"; - len = strlen (home) + (append ? strlen (append) : 0); + len = strlen (home) + (append ? strlen (append) : 0) + 1; str = malloc (len); if (str == NULL) { perror ("malloc"); -- 1.8.3.1