You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/08/28 17:53:02 UTC

svn commit: r1378193 - /subversion/trunk/subversion/libsvn_subr/gpg_agent.c

Author: stsp
Date: Tue Aug 28 15:53:01 2012
New Revision: 1378193

URL: http://svn.apache.org/viewvc?rev=1378193&view=rev
Log:
* subversion/libsvn_subr/gpg_agent.c
  (receive_from_gpg_agent): Clear the response buffer before attemping
    to read a response from the agent. Prevents this function from
    returning a stale response it obtained during a previous invocation
    in case the gpg agent doesn't respond or sends an empty reponse.

Modified:
    subversion/trunk/subversion/libsvn_subr/gpg_agent.c

Modified: subversion/trunk/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/gpg_agent.c?rev=1378193&r1=1378192&r2=1378193&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/trunk/subversion/libsvn_subr/gpg_agent.c Tue Aug 28 15:53:01 2012
@@ -110,6 +110,10 @@ receive_from_gpg_agent(int sd, char *buf
   int recvd;
   char c;
 
+  /* Clear existing buffer concent before reading response. */
+  if (n > 0)
+    *buf = '\0';
+
   /* Require the message to fit into the buffer and be terminated
    * with a newline. */
   while (i < n)