Home GnuPG
Diffusion GnuPG 367b073ab5f4

avoid future chance of using uninitialized memory
367b073ab5f4Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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.

Details

Provenance
dkgAuthored on Dec 19 2014, 11:53 PM
wernerCommitted on Dec 22 2014, 1:14 PM
Parents
rG628b111fa679: avoid double-close in unusual dotlock situations
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG367b073ab5f4: avoid future chance of using uninitialized memory (authored by Daniel Kahn Gillmor <dkg@fifthhorseman.net>).Dec 22 2014, 1:14 PM