[Pkg-gnupg-commit] [gnupg2] 149/241: common: Avoid undefined behavior.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Dec 9 20:32:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit eb957ffc4797fb019c505510295af244baf5be38
Author: Justus Winter <justus at g10code.com>
Date:   Thu Nov 19 16:13:55 2015 +0100

    common: Avoid undefined behavior.
    
    * common/iobuf.c (iobuf_esopen): Initialize 'len' as 'file_es_filter'
    will make use of it.
    --
    Found using the Clang Static Analyzer.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 common/iobuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/iobuf.c b/common/iobuf.c
index 12affcb..d49de96 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -1391,7 +1391,7 @@ iobuf_esopen (estream_t estream, const char *mode, int keep_open)
 {
   iobuf_t a;
   file_es_filter_ctx_t *fcx;
-  size_t len;
+  size_t len = 0;
 
   a = iobuf_alloc (strchr (mode, 'w') ? IOBUF_OUTPUT : IOBUF_INPUT,
 		   IOBUF_BUFFER_SIZE);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list