~ubuntu-branches/ubuntu/utopic/dropbear/utopic-proposed

« back to all changes in this revision

Viewing changes to libtommath/bn_mp_zero.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Johnston
  • Date: 2005-12-08 19:20:21 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051208192021-nyp9rwnt77nsg6ty
Tags: 0.47-1
* New upstream release.
* SECURITY: Fix incorrect buffer sizing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
 
18
18
/* set to zero */
19
 
void
20
 
mp_zero (mp_int * a)
 
19
void mp_zero (mp_int * a)
21
20
{
 
21
  int       n;
 
22
  mp_digit *tmp;
 
23
 
22
24
  a->sign = MP_ZPOS;
23
25
  a->used = 0;
24
 
  memset (a->dp, 0, sizeof (mp_digit) * a->alloc);
 
26
 
 
27
  tmp = a->dp;
 
28
  for (n = 0; n < a->alloc; n++) {
 
29
     *tmp++ = 0;
 
30
  }
25
31
}
26
32
#endif