aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <[email protected]>2014-12-19 22:53:36 +0000
committerNIIBE Yutaka <[email protected]>2015-01-13 01:52:22 +0000
commit1fc4dc541af7d4bf4dba6ef37d1d7841498a05c6 (patch)
tree16f2af3a6bf36680a02d081defab0ff64b43c987
parentgpgkey2ssh: clean up varargs (diff)
downloadgnupg-1fc4dc541af7d4bf4dba6ef37d1d7841498a05c6.tar.gz
gnupg-1fc4dc541af7d4bf4dba6ef37d1d7841498a05c6.zip
avoid future chance of using uninitialized memory
* common/iobuf.c: (iobuf_open): initialize len -- In iobuf_open, IOBUFCTRL_DESC and IOBUFCTRL_INIT commands are invoked (via file_filter()) on fcx, passing in a pointer to an uninitialized len. With these two commands, file_filter doesn't actually do anything with the value of len, so there's no actual risk of use of uninitialized memory in the code as it stands. However, some static analysis tools might flag this situation with a warning, and initializing the value doesn't hurt anything, so i think this trivial cleanup is warranted. Debian-Bug-Id: 773469
-rw-r--r--common/iobuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index ae9bfa94d..4c6d5b5d5 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -1303,7 +1303,7 @@ iobuf_open (const char *fname)
iobuf_t a;
fp_or_fd_t fp;
file_filter_ctx_t *fcx;
- size_t len;
+ size_t len = 0;
int print_only = 0;
int fd;