From 6e4d721c9376ace9d00b6026fc3ddb79cbdfd699 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 10 Jul 2000 14:06:27 +0000 Subject: [PATCH] See ChangeLog: Mon Jul 10 16:08:57 CEST 2000 Werner Koch --- THANKS | 1 + g10/ChangeLog | 5 +++++ g10/parse-packet.c | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/THANKS b/THANKS index 6a367d389..dd9ea4ffe 100644 --- a/THANKS +++ b/THANKS @@ -96,6 +96,7 @@ Oskari J Paul D. Smith psmith@baynetworks.com Philippe Laliberte arsphl@oeil.qc.ca Peter Gutmann pgut001@cs.auckland.ac.nz +Peter Marschall Peter.Marschall@gedos.de QingLong qinglong@bolizm.ihep.su Ralph Gillen gillen@theochem.uni-duesseldorf.de Rat ratinox@peorth.gweep.net diff --git a/g10/ChangeLog b/g10/ChangeLog index e231e6952..630f550aa 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 10 16:08:57 CEST 2000 Werner Koch + + * parse-packet.c (enum_sig_subpkt): Fixed testing on crtitical bit in case + of a NULL buffer. Reported by Peter Marschall. + Wed Jul 5 13:28:45 CEST 2000 Werner Koch * keyedit.c, keyid.c: Add some _() diff --git a/g10/parse-packet.c b/g10/parse-packet.c index bc720f756..f63f051b3 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -920,8 +920,12 @@ enum_sig_subpkt( const byte *buffer, sigsubpkttype_t reqtype, int seq = 0; int reqseq = start? *start: 0; - if( !buffer || reqseq == -1 ) - return NULL; + if( !buffer || reqseq == -1 ) { + /* return some value different from NULL to indicate that + * there is no crtitical bit we do not understand. The caller + * will never use the value. Yes I know, it is an ugly hack */ + return reqtype == SIGSUBPKT_TEST_CRITICAL? (const byte*)&buffer : NULL; + } buflen = (*buffer << 8) | buffer[1]; buffer += 2; while( buflen ) {