aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/engine-spawn.c2
-rw-r--r--src/posix-util.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/engine-spawn.c b/src/engine-spawn.c
index bfcad3d9..8ffc6280 100644
--- a/src/engine-spawn.c
+++ b/src/engine-spawn.c
@@ -250,7 +250,7 @@ engspawn_start (engine_spawn_t esp, const char *file, const char *argv[],
n = 0;
for (i = 0; esp->fd_data_map[i].data; i++)
n++;
- fd_list = calloc (n, sizeof *fd_list);
+ fd_list = calloc (n+1, sizeof *fd_list);
if (!fd_list)
return gpg_error_from_syserror ();
diff --git a/src/posix-util.c b/src/posix-util.c
index e78cd771..f7e0a171 100644
--- a/src/posix-util.c
+++ b/src/posix-util.c
@@ -95,7 +95,7 @@ walk_path (const char *pgm)
{
for (s=path, p=fname; *s && *s != ':'; s++, p++)
*p = *s;
- if (*p != '/')
+ if (p != fname && p[-1] != '/')
*p++ = '/';
strcpy (p, pgm);
if (!access (fname, X_OK))