1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-22 14:57:02 +01:00

gpg: Fix a NULL-deref in export due to invalid packet lengths.

* g10/build-packet.c (write_fake_data): Take care of a NULL stored as
opaque MPI.
--

Reported-by: Hanno Böck <hanno@hboeck.de>

(back ported from commit 0835d2f44ef62eab51fce6a927908f544e01cf8f)
This commit is contained in:
Werner Koch 2015-02-12 18:54:17 +01:00
parent 7e12ec4c7d
commit 8da836e76f

View File

@ -220,7 +220,8 @@ write_fake_data (IOBUF out, gcry_mpi_t a)
void *p;
p = gcry_mpi_get_opaque ( a, &n );
iobuf_write (out, p, (n+7)/8 );
if (p)
iobuf_write (out, p, (n+7)/8 );
}
}