aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-04-16 18:57:23 +0000
committerWerner Koch <[email protected]>2007-04-16 18:57:23 +0000
commit685b56a0d364247d2689d460d258d72d294d3a0d (patch)
tree1f3495cda83befc6aaa66a62d6409fb018c6bc1f
parent* gpg.texi (OpenPGP Options): Update the personal-foo-preferences (diff)
downloadgnupg-685b56a0d364247d2689d460d258d72d294d3a0d.tar.gz
gnupg-685b56a0d364247d2689d460d258d72d294d3a0d.zip
* build-packet.c (mpi_write): Made buffer a bit larger. Reported
by Alexander Feigl.
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/build-packet.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index bbd969982..c8ce0c951 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-16 Werner Koch <[email protected]>
+
+ * build-packet.c (mpi_write): Made buffer a bit larger. Reported
+ by Alexander Feigl.
+
2007-04-13 Werner Koch <[email protected]>
* call-agent.c (start_agent): Don't use log_error when using the
diff --git a/g10/build-packet.c b/g10/build-packet.c
index 3664b8e94..e6c9734e8 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -157,11 +157,11 @@ build_packet( IOBUF out, PACKET *pkt )
static int
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;
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 );
if( !rc )
rc = iobuf_write( out, buffer, nbytes );