aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-03-08 12:11:58 +0000
committerWerner Koch <[email protected]>2007-03-08 12:11:58 +0000
commitf7c1efc8806510426711f7e36cb03ea7e79c7a6b (patch)
tree6f9a1bacfbadc0a593bc81111a3983aa474b9782 /g10/plaintext.c
parentFix from 1.4: (diff)
downloadgnupg-f7c1efc8806510426711f7e36cb03ea7e79c7a6b.tar.gz
gnupg-f7c1efc8806510426711f7e36cb03ea7e79c7a6b.zip
Add extra flushs
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 6c58ae7d7..fd165237e 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);
@@ -394,8 +400,13 @@ 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);
+ fclose (fp);
xfree(fname);
return rc;
}