summaryrefslogtreecommitdiffstats
path: root/fish/tilde.c
diff options
context:
space:
mode:
authorKarel Klíč <kklic@redhat.com>2010-10-25 12:48:36 +0100
committerRichard W.M. Jones <rjones@redhat.com>2010-10-25 12:48:36 +0100
commit1d5ec10659d67020c5b709e4df4c49bc0d59d58c (patch)
tree66405a35758ba108c39a1fd9095f9bdded3e2e11 /fish/tilde.c
parent247324a4b3d9bf4782e18a629463a808d361fada (diff)
downloadlibguestfs-1d5ec10659d67020c5b709e4df4c49bc0d59d58c.tar.gz
libguestfs-1d5ec10659d67020c5b709e4df4c49bc0d59d58c.tar.xz
libguestfs-1d5ec10659d67020c5b709e4df4c49bc0d59d58c.zip
fish: Fix too-short allocation in tilde expansion (RHBZ#636061).
Diffstat (limited to 'fish/tilde.c')
-rw-r--r--fish/tilde.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fish/tilde.c b/fish/tilde.c
index c599e16f..83aa70d9 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");