mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
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 <wk@gnupg.org>
This commit is contained in:
parent
b7f56ba5e3
commit
65eb156980
@ -4308,6 +4308,7 @@ read_parameter_file (ctrl_t ctrl, const char *fname )
|
|||||||
para = NULL;
|
para = NULL;
|
||||||
maxlen = 1024;
|
maxlen = 1024;
|
||||||
line = NULL;
|
line = NULL;
|
||||||
|
nline = 0;
|
||||||
while ( iobuf_read_line (fp, &line, &nline, &maxlen) ) {
|
while ( iobuf_read_line (fp, &line, &nline, &maxlen) ) {
|
||||||
char *keyword, *value;
|
char *keyword, *value;
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ copy_clearsig_text( IOBUF out, IOBUF inp, gcry_md_hd_t md,
|
|||||||
{
|
{
|
||||||
unsigned int maxlen;
|
unsigned int maxlen;
|
||||||
byte *buffer = NULL; /* malloced buffer */
|
byte *buffer = NULL; /* malloced buffer */
|
||||||
unsigned int bufsize; /* and size of this buffer */
|
unsigned int bufsize = 0; /* and size of this buffer */
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
int truncated = 0;
|
int truncated = 0;
|
||||||
int pending_lf = 0;
|
int pending_lf = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user