1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-20 01:02:44 +02:00

* build-packet.c (mpi_write): Made buffer a bit larger. Reported

by Alexander Feigl.
This commit is contained in:
Werner Koch 2007-04-16 18:57:23 +00:00
parent 2be1afb5aa
commit 685b56a0d3
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-04-16 Werner Koch <wk@g10code.com>
* build-packet.c (mpi_write): Made buffer a bit larger. Reported
by Alexander Feigl.
2007-04-13 Werner Koch <wk@g10code.com> 2007-04-13 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Don't use log_error when using the * call-agent.c (start_agent): Don't use log_error when using the

View File

@ -157,11 +157,11 @@ build_packet( IOBUF out, PACKET *pkt )
static int static int
mpi_write (iobuf_t out, gcry_mpi_t a) mpi_write (iobuf_t out, gcry_mpi_t a)
{ {
char buffer[(MAX_EXTERN_MPI_BITS+7)/8]; char buffer[(MAX_EXTERN_MPI_BITS+7)/8+2]; /* 2 is for the mpi length. */
size_t nbytes; size_t nbytes;
int rc; int rc;
nbytes = (MAX_EXTERN_MPI_BITS+7)/8 + 2; /* 2 is for the mpi length. */ nbytes = DIM(buffer);
rc = gcry_mpi_print (GCRYMPI_FMT_PGP, buffer, nbytes, &nbytes, a ); rc = gcry_mpi_print (GCRYMPI_FMT_PGP, buffer, nbytes, &nbytes, a );
if( !rc ) if( !rc )
rc = iobuf_write( out, buffer, nbytes ); rc = iobuf_write( out, buffer, nbytes );