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 2011/07/25 16:47:35 UTC
svn commit: r1150729 -
/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
Author: stsp
Date: Mon Jul 25 14:47:34 2011
New Revision: 1150729
URL: http://svn.apache.org/viewvc?rev=1150729&view=rev
Log:
On the gpg-agent-password-store branch, avoid a potential NULL-derefernce.
* subversion/libsvn_auth_gpg_agent/gpg_agent.c
(password_get_gpg_agent): Do not crash if the agent returns an empty
string as password.
Modified:
subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c?rev=1150729&r1=1150728&r2=1150729&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_auth_gpg_agent/gpg_agent.c Mon Jul 25 14:47:34 2011
@@ -294,6 +294,9 @@ password_get_gpg_agent(const char **pass
if (strncmp(buffer, "D", 1) == 0)
p = &buffer[2];
+ if (!p)
+ return FALSE;
+
ep = strchr(p, '\n');
if (ep != NULL)
*ep = '\0';