Fixed that nasty 64 bit but.

This commit is contained in:
Werner Koch 2006-11-10 11:32:00 +00:00
parent c1f4a8edff
commit cd3e8c9b89
2 changed files with 17 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2006-11-10 Werner Koch <wk@g10code.com>
* parse-packet.c (mpi_read): Changed NREAD to size_t to match the
gcry_mpi-scan prototype.
(mpi_read): Fixed double increment of bytes read to correctly
detect overlong MPIs.
2006-11-05 Werner Koch <wk@g10code.com>
* gpg.c (main): Remove the default --require-cross-certification.

View File

@ -112,7 +112,8 @@ mpi_read (iobuf_t inp, unsigned int *ret_nread, int secure)
/*FIXME: Needs to be synced with gnupg14/mpi/mpicoder.c*/
int c, c1, c2, i;
unsigned int nbits, nbytes, nread=0;
unsigned int nbits, nbytes;
size_t nread;
gcry_mpi_t a = NULL;
byte *buf = NULL;
byte *p;
@ -139,7 +140,6 @@ mpi_read (iobuf_t inp, unsigned int *ret_nread, int secure)
p[i+2] = iobuf_get(inp) & 0xff;
nread++;
}
nread += nbytes;
if ( gcry_mpi_scan( &a, GCRYMPI_FMT_PGP, buf, nread, &nread ) )
a = NULL;