diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 4 | ||||
-rw-r--r-- | common/membuf.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index 336b3928a..eeba09341 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,7 @@ +2004-12-20 Werner Koch <[email protected]> + + * membuf.c (put_membuf): Wipe out buffer after a failed realloc. + 2004-12-19 Werner Koch <[email protected]> * maperror.c (map_assuan_err_with_source): Oops, args were swapped. diff --git a/common/membuf.c b/common/membuf.c index 69e4ab908..75f6bdb2a 100644 --- a/common/membuf.c +++ b/common/membuf.c @@ -60,6 +60,11 @@ put_membuf (membuf_t *mb, const void *buf, size_t len) if (!p) { mb->out_of_core = errno; + /* Wipe out what we already accumulated. This is required + in case we are storing sensitive data here. The membuf + API does not provide another way to cleanup after an + error. */ + memset (mb->buf, 0, mb->len); return; } mb->buf = p; |