aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-09-04 09:24:34 +0000
committerWerner Koch <[email protected]>2020-09-04 09:32:47 +0000
commit65eb1569809a3c42e8afb064f6194fac2e34a03a (patch)
tree867008078db8e4e807071aaea885ea91ca78c516 /g10/keygen.c
parenttests: New test run envvar to run gpg under valgrind. (diff)
downloadgnupg-65eb1569809a3c42e8afb064f6194fac2e34a03a.tar.gz
gnupg-65eb1569809a3c42e8afb064f6194fac2e34a03a.zip
gpg: Initialize a parameter to silence valgrind.
* g10/keygen.c (read_parameter_file): Initialize nline. * g10/textfilter.c (copy_clearsig_text): Initialize bufsize. -- In iobuf_read_line the parameter to pass and return the current buffer length is controlled by the buffer parameter. Thus there should be no problem because the assert call check s buffer first. For yet unknown reasons when using the standard GNU libc assert valgrind complains about an uninitialized variable. That does not happen with our log_assert. Tested with gnupg 2.2.23 with gcc 8.3.0 and valgrind 3.14.0. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/keygen.c')
-rw-r--r--g10/keygen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index cf34d8f99..d3de98d32 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -4308,6 +4308,7 @@ read_parameter_file (ctrl_t ctrl, const char *fname )
para = NULL;
maxlen = 1024;
line = NULL;
+ nline = 0;
while ( iobuf_read_line (fp, &line, &nline, &maxlen) ) {
char *keyword, *value;