Mercurial > hg > waaad
changeset 347:1410a823ede0
Clear buffer for clean padding
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 28 Apr 2009 14:51:43 +0900 |
parents | 6b403157764e |
children | 7907e7cc0aef |
files | waaad/message.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/waaad/message.c Tue Apr 28 14:24:02 2009 +0900 +++ b/waaad/message.c Tue Apr 28 14:51:43 2009 +0900 @@ -2136,6 +2136,9 @@ /* Now allocate a buffer to store the message */ CHECK_MALLOC( buf = malloc(_M(msg)->msg_public.msg_length) ); + /* Clear the memory, so that the padding is always 0 */ + memset(buf, 0, _M(msg)->msg_public.msg_length); + /* Write the message header in the buffer */ CHECK_FCT_DO( ret = _msg_buf_msg(buf, _M(msg)->msg_public.msg_length, &offset, _M(msg)), {