gpg: Fix broken write of opaque MPI length header.
authorWerner Koch <wk@gnupg.org>
Mon, 16 Mar 2015 18:51:06 +0000 (19:51 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 16 Mar 2015 18:51:06 +0000 (19:51 +0100)
* g10/build-packet.c (gpg_mpi_write): Use a char array for the length.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/build-packet.c

index 557dffe..e984e3e 100644 (file)
@@ -165,7 +165,7 @@ gpg_mpi_write (iobuf_t out, gcry_mpi_t a)
     {
       unsigned int nbits;
       const void *p;
-      unsigned int lenhdr[2];
+      unsigned char lenhdr[2];
 
       p = gcry_mpi_get_opaque (a, &nbits);
       lenhdr[0] = nbits >> 8;