diff --git a/g10/build-packet.c b/g10/build-packet.c index 2e6dfc026..538f2fe13 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -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 ); } }