aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index dec3b532c..92187a572 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -1,6 +1,6 @@
/* plaintext.c - process plaintext packets
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- * 2005 Free Software Foundation, Inc.
+ * 2005, 2006 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -177,8 +177,14 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
#endif /* __riscos__ */
if( !pt->is_partial ) {
- /* we have an actual length (which might be zero). */
- assert( !clearsig );
+ /* We have an actual length (which might be zero). */
+
+ if (clearsig) {
+ log_error ("clearsig encountered while not expected\n");
+ rc = G10ERR_UNEXPECTED;
+ goto leave;
+ }
+
if( convert ) { /* text mode */
for( ; pt->len; pt->len-- ) {
if( (c = iobuf_get(pt->buf)) == -1 ) {