[svn] GnuPG - r5339 - branches/STABLE-BRANCH-2-0/g10

svn author wk cvs at cvs.gnupg.org
Wed May 12 12:53:03 CEST 2010


Author: wk
Date: 2010-05-12 12:53:02 +0200 (Wed, 12 May 2010)
New Revision: 5339

Modified:
   branches/STABLE-BRANCH-2-0/g10/ChangeLog
   branches/STABLE-BRANCH-2-0/g10/plaintext.c
Log:
Fix bug 1207


Modified: branches/STABLE-BRANCH-2-0/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/ChangeLog	2010-05-12 10:35:58 UTC (rev 5338)
+++ branches/STABLE-BRANCH-2-0/g10/ChangeLog	2010-05-12 10:53:02 UTC (rev 5339)
@@ -1,3 +1,8 @@
+2010-05-12  Werner Koch  <wk at g10code.com>
+
+	* plaintext.c (handle_plaintext): Check return code of fflush.
+	Fixes bug#1207.
+
 2010-05-07  Werner Koch  <wk at g10code.com>
 
 	* import.c (chk_self_sigs): Check direct key signatures.  Fixes

Modified: branches/STABLE-BRANCH-2-0/g10/plaintext.c
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/plaintext.c	2010-05-12 10:35:58 UTC (rev 5338)
+++ branches/STABLE-BRANCH-2-0/g10/plaintext.c	2010-05-12 10:53:02 UTC (rev 5339)
@@ -402,7 +402,15 @@
     /* Make sure that stdout gets flushed after the plaintext has
        been handled.  This is for extra security as we do a
        flush anyway before checking the signature.  */
-    fflush (stdout);
+    if (fflush (stdout))
+      {
+        /* We need to check the return code to detect errors like disk
+           full for short plaintexts.  See bug#1207.  Checking return
+           values is a good idea in any case.  */
+        if (!rc)
+          rc = gpg_error_from_syserror ();
+        log_error ("error flushing `%s': %s\n", "[stdout]", strerror (errno) );
+      }
 
     if( fp && fp != stdout )
       fclose (fp);




More information about the Gnupg-commits mailing list