mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpgconf: Fix argv overflow if --homedir is used.
* tools/gpgconf-comp.c (gc_component_launch): Fix crash due to too small array. -- GnuPG-bug-id: 5366 Depending on the stack layout this could have led to zeroing out the PID variable if --homedir was used and thus under Windows to a leaked handle. However, gpgconf is a short running process and thus no really harm. Co-authored-by: cbiedl@gnupg.com Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
87d7b7e075
commit
a50093893c
@ -1260,7 +1260,7 @@ gc_component_launch (int component)
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
const char *pgmname;
|
const char *pgmname;
|
||||||
const char *argv[5];
|
const char *argv[6];
|
||||||
int i;
|
int i;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
@ -1300,6 +1300,7 @@ gc_component_launch (int component)
|
|||||||
argv[i++] = "--dirmngr";
|
argv[i++] = "--dirmngr";
|
||||||
argv[i++] = "NOP";
|
argv[i++] = "NOP";
|
||||||
argv[i] = NULL;
|
argv[i] = NULL;
|
||||||
|
log_assert (i < DIM(argv));
|
||||||
|
|
||||||
err = gnupg_spawn_process_fd (pgmname, argv, -1, -1, -1, &pid);
|
err = gnupg_spawn_process_fd (pgmname, argv, -1, -1, -1, &pid);
|
||||||
if (!err)
|
if (!err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user