1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-18 00:49:50 +02: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 0835d2f44e)

[dkg: rebased to STABLE-BRANCH-1-4]
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Werner Koch 2015-02-21 23:10:29 -05:00
parent 2e8db53854
commit 68f260f77a
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -193,7 +193,8 @@ write_fake_data( IOBUF out, MPI a )
void *p;
p = mpi_get_opaque( a, &i );
iobuf_write( out, p, i );
if (p)
iobuf_write( out, p, i );
}
}