diff options
author | Werner Koch <[email protected]> | 2010-05-12 10:53:02 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-05-12 10:53:02 +0000 |
commit | e70fc9d8c9e3b075c330cfae5673fa8005841026 (patch) | |
tree | 3497c80e04f52cc7c9d90431fbf64fe3f049f571 | |
parent | Include NETLIBS (diff) | |
download | gnupg-e70fc9d8c9e3b075c330cfae5673fa8005841026.tar.gz gnupg-e70fc9d8c9e3b075c330cfae5673fa8005841026.zip |
Fix bug 1207
-rw-r--r-- | g10/ChangeLog | 5 | ||||
-rw-r--r-- | g10/plaintext.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index e844e523a..78c4799cc 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2010-05-12 Werner Koch <[email protected]> + + * plaintext.c (handle_plaintext): Check return code of fflush. + Fixes bug#1207. + 2010-05-07 Werner Koch <[email protected]> * import.c (chk_self_sigs): Check direct key signatures. Fixes diff --git a/g10/plaintext.c b/g10/plaintext.c index 34e18f65f..377764833 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -402,7 +402,15 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx, /* 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); |