diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2021-01-31 16:59:37 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2021-02-04 12:49:08 +0100 |
commit | 3f42f727a0699f7274a99ea39def7f9b4c3b0c1e (patch) | |
tree | 969bf7a0316bac581ffb5911b81994b4da3937d0 | |
parent | 370e441272875eb341240bd7e0d03b81a54002b6 (diff) | |
download | libgcrypt-3f42f727a0699f7274a99ea39def7f9b4c3b0c1e.tar.gz |
Make sure the grcy_get_config string is always null-terminated.
* src/global.c (_gcry_get_config): Append null-terminator to output.
--
Config string was not being explicitly null-terminated which resulted
garbage output from tests/version with ASAN enabled builds.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
-rw-r--r-- | src/global.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/global.c b/src/global.c index cd3d9d90..7d634095 100644 --- a/src/global.c +++ b/src/global.c @@ -418,6 +418,10 @@ _gcry_get_config (int mode, const char *what) return NULL; print_config (what, fp); + + /* Make sure the output is null terminated. */ + gpgrt_fwrite ("", 1, 1, fp); + if (gpgrt_ferror (fp)) { save_errno = errno; |