[Pkg-gnupg-commit] [libgpg-error] 05/15: estream: Fix assertion failure due to es_flush.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jun 17 00:26:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository libgpg-error.

commit 28fd0ab40739e8cb73f208e30f78d8aa7a0a6d19
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Jun 15 11:44:35 2016 +0200

    estream: Fix assertion failure due to es_flush.
    
    * src/estream.c (es_writen): Set writing flag even if no data was
    written.
    --
    
    GnuPG-bug-id: 2371
    Signed-off-by: Werner Koch <wk at gnupg.org>
    
    gniibe tracked the problem down to a fully valid change in GnuPG
    (gnupg commit 12af2630cf4d1a39179179925fac8f2cce7504ff).  He wrote:
    
    This is the first instance for estream to do READ and WRITE
    (in the history of the code > 10 years :-).  In the [gnupg] function
    agent_write_private_key, the pattern is:
    
        es_fopen
        es_fread
        es_fseek
        es_fwrite
    
    which should work well, but if results core dump by assertion failure
    in the function es_flush of libgpg-error.
---
 src/estream.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/estream.c b/src/estream.c
index 2033b23..e382a29 100644
--- a/src/estream.c
+++ b/src/estream.c
@@ -2679,6 +2679,7 @@ es_writen (estream_t _GPGRT__RESTRICT stream,
               else
                 goto out;
             }
+          stream->flags.writing = 1;
         }
     }
 
@@ -2701,9 +2702,6 @@ es_writen (estream_t _GPGRT__RESTRICT stream,
 
   if (bytes_written)
     *bytes_written = data_written;
-  if (data_written)
-    if (!stream->flags.writing)
-      stream->flags.writing = 1;
 
   return err;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libgpg-error.git



More information about the Pkg-gnupg-commit mailing list