From: Karel Klíč Date: Mon, 25 Oct 2010 11:48:36 +0000 (+0100) Subject: fish: Fix too-short allocation in tilde expansion (RHBZ#636061). X-Git-Tag: 1.5.24~17 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=1d5ec10659d67020c5b709e4df4c49bc0d59d58c;p=libguestfs.git fish: Fix too-short allocation in tilde expansion (RHBZ#636061). --- 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");