From 33ac735a781325c4d47cdf6216813866ab93562e Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 23 Feb 2016 21:07:09 +0100 Subject: gpg: Use higher-level functions. * g10/build-packet.c (do_symkey_enc): Use iobuf_write instead of iobuf_put in a loop. Use iobuf_copy instead of iobuf_read and iobuf_write in a loop. Move the memory wiping from here... * common/iobuf.c (iobuf_copy): ... to here. -- Signed-off-by: Neal H. Walfield --- common/iobuf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/iobuf.c') diff --git a/common/iobuf.c b/common/iobuf.c index 1f2cd3f5d..a0d48c669 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -2253,6 +2253,9 @@ iobuf_copy (iobuf_t dest, iobuf_t source) break; nwrote += nread; } + + /* Burn the buffer. */ + wipememory (temp, sizeof (temp)); xfree (temp); return nwrote; -- cgit v1.2.3