diff options
author | Werner Koch <wk@gnupg.org> | 2022-04-14 13:53:55 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2022-04-14 13:56:10 +0200 |
commit | 41fb46007e65be76cffbe2a19135facc3db912c5 (patch) | |
tree | ecdddbe5d8f05f73ccc391d523389f7b23b95287 /g10/build-packet.c | |
parent | ssh: Returned faked response for the new session-bind extension. (diff) | |
download | gnupg2-41fb46007e65be76cffbe2a19135facc3db912c5.tar.xz gnupg2-41fb46007e65be76cffbe2a19135facc3db912c5.zip |
gpg: Replace an assert by a log_fatal.
* g10/build-packet.c (do_signature): Use log_fatal.
--
GnuPG-bug-id: 5809
Diffstat (limited to '')
-rw-r--r-- | g10/build-packet.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/g10/build-packet.c b/g10/build-packet.c index 268bd71b2..a631db8d8 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -1747,9 +1747,12 @@ do_signature( IOBUF out, int ctb, PKT_signature *sig ) { iobuf_put( a, 3 ); - /* Version 3 packets don't support subpackets. */ - log_assert (! sig->hashed); - log_assert (! sig->unhashed); + /* Version 3 packets don't support subpackets. Actually we + * should never get to here but real life is different and thus + * we now use a log_fatal instead of a log_assert here. */ + if (sig->hashed || sig->unhashed) + log_fatal ("trying to write a subpacket to a v3 signature (%d,%d)\n", + !!sig->hashed, !!sig->unhashed); } else iobuf_put( a, sig->version ); |