aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-03-08 12:13:15 +0000
committerWerner Koch <[email protected]>2007-03-08 12:13:15 +0000
commit7b3e35a24c1363653eb068dc359a7eac609c40f6 (patch)
tree9d85701be04b5a9399a74a308976c44d17907d01
parent* keyedit.c (keyedit_menu): If we modify the keyblock (via (diff)
downloadgnupg-7b3e35a24c1363653eb068dc359a7eac609c40f6.tar.gz
gnupg-7b3e35a24c1363653eb068dc359a7eac609c40f6.zip
Add extra fflush (stdout)
-rw-r--r--g10/ChangeLog4
-rw-r--r--g10/plaintext.c11
2 files changed, 15 insertions, 0 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 81676d7ba..51f00d5de 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,7 @@
+2007-03-08 Werner Koch <[email protected]>
+
+ * plaintext.c (handle_plaintext): Add two extra fflush for stdout.
+
2007-03-06 David Shaw <[email protected]>
* keyedit.c (keyedit_menu): If we modify the keyblock (via
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 243296b7f..b05aead47 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -69,6 +69,12 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
{
char status[50];
+ /* Better make sure that stdout has been flushed in case the
+ output will be written to it. This is to make sure that no
+ not-yet-flushed stuff will be written after the plaintext
+ status message. */
+ fflush (stdout);
+
sprintf(status,"%X %lu ",(byte)pt->mode,(ulong)pt->timestamp);
write_status_text_and_buffer(STATUS_PLAINTEXT,
status,pt->name,pt->namelen,0);
@@ -385,6 +391,11 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
fp = NULL;
leave:
+ /* 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( fp && fp != stdout )
fclose(fp);
xfree(fname);