Page MenuHome GnuPG

"*** stack smashing detected ***" in test suite
Closed, ResolvedPublic

Description

When building with -fstack-protector-strong, the test suite will fail in various places with

*** stack smashing detected ***: terminated

Steps to reproduce:

./autogen.sh
./configure --sysconfdir=/etc --enable-maintainer-mode
make CFLAGS='-fstack-protector-strong'
make check

This was introduced in

commit c1844ca7520f9a67bff85ee4fbf49c6725668289
Author: Werner Koch <wk@gnupg.org>
Date:   Thu Mar 19 12:43:08 2020 +0100

    gpgconf: Take care of --homedir when reading/updating options.

Suggested fix:

--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -1164,7 +1164,7 @@ gc_component_check_options (int component, estream_t out, const char *conf_file)
   gpg_error_t err;
   unsigned int result;
   const char *pgmname;
-  const char *argv[5];
+  const char *argv[6];
   int i;
   pid_t pid;
   int exitcode;

This makes the tests pass in the described scenario.