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

« back to all changes in this revision

Viewing changes to libtommath/mtest/mtest.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:
46
46
   int n, size;
47
47
   unsigned char buf[2048];
48
48
 
49
 
   size = 1 + ((fgetc(rng)<<8) + fgetc(rng)) % 1031;
 
49
   size = 1 + ((fgetc(rng)<<8) + fgetc(rng)) % 101;
50
50
   buf[0] = (fgetc(rng)&1)?1:0;
51
51
   fread(buf+1, 1, size, rng);
52
52
   while (buf[1] == 0) buf[1] = fgetc(rng);
58
58
   int n, size;
59
59
   unsigned char buf[2048];
60
60
 
61
 
   size = 10 + ((fgetc(rng)<<8) + fgetc(rng)) % 97;
 
61
   size = 10 + ((fgetc(rng)<<8) + fgetc(rng)) % 101;
62
62
   buf[0] = (fgetc(rng)&1)?1:0;
63
63
   fread(buf+1, 1, size, rng);
64
64
   while (buf[1] == 0) buf[1] = fgetc(rng);