Home GnuPG
Diffusion GnuPG e7cbce8fb2b7

avoid future chance of using uninitialized memory
e7cbce8fb2b7Unpublished

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

* util/iobuf.c: (iobuf_open): initialize len

Cherry-pick 367b073ab5f439ccf0750461d10c69f36998bd62.

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
gniibeCommitted on Jan 13 2015, 3:06 AM
Parents
rGe2e822d22526: doc: Fix memory leak in yat2m.
Branches
Unknown
Tags
Unknown

Event Timeline

NIIBE Yutaka <gniibe@fsij.org> committed rGe7cbce8fb2b7: avoid future chance of using uninitialized memory (authored by Daniel Kahn Gillmor <dkg@fifthhorseman.net>).Jan 13 2015, 3:06 AM