[Pcsclite-git-commit] [PCSC] 01/01: pcscd: do not write to a closed file handle

Ludovic Rousseau rousseau at moszumanska.debian.org
Sun Aug 9 08:24:18 UTC 2015


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

rousseau pushed a commit to branch master
in repository PCSC.

commit 79410aac02a370d6d92106c015f01ec1491d31ac
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Sun Aug 9 10:21:49 2015 +0200

    pcscd: do not write to a closed file handle
    
    " In case of receiving a signal to terminate after init has been
    completed, at_exit() is called and tries to write to a closed pipe.
    
    This patch simply set pipe to -1 in order to invalidate it after
    closing.  Pipe value checks are already present in the code. "
    
    Signed-off-by: Herve Codina <Herve.CODINA at celad.com>
---
 src/pcscdaemon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/pcscdaemon.c b/src/pcscdaemon.c
index 27ee6c9..27e3e9a 100644
--- a/src/pcscdaemon.c
+++ b/src/pcscdaemon.c
@@ -681,6 +681,7 @@ int main(int argc, char **argv)
 			Log2(PCSC_LOG_ERROR, "write() failed: %s", strerror(errno));
 		}
 		close(pipefd[1]);
+		pipefd[1] = -1;
 	}
 
 	SVCServiceRunLoop();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git



More information about the Pcsclite-cvs-commit mailing list