[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Re: svn_auth_cred_simple_t crash

From: Martin Hauner <hauner_at_web.de>
Date: 2005-03-14 19:38:22 CET

sorry for posting this again, i forgot to add the patch marker..

Ben Collins-Sussman wrote:
>
> On Mar 13, 2005, at 8:56 AM, Martin Hauner wrote:
>
>>
>> If you think it should be not 0, i can create a doc patch for it.
>
>
> Hm, yes, would you do that? :-)

Here we go... 2 versions, i guess the second is the better one.

> We had a discussion about these sorts of APIs earlier this week on the
> list; in general, we decided that NULL input parameters are not allowed
> unless the docstring explicitly says so. In that same spirit, I think
> that fields of any sort of auth credential structure shouldn't come back
> as NULL unless the docstring explicitly says so.

Hmm, that somehow makes the patch unecessary...

But i think the doc patch is usefull anyway because the password is kind
of "optional" and it is nice to know in this case to use an empty string
instead of a 0 pointer.

-- 
Martin
Subcommander, http://subcommander.tigris.org
a x-platform Win32/Unix svn gui (qt) client & a text diff/merge tool.

Index: subversion/include/svn_auth.h
===================================================================
--- subversion/include/svn_auth.h (revision 13396)
+++ subversion/include/svn_auth.h (working copy)
@@ -155,7 +155,11 @@
 
 
 
-/** Specific types of credentials **/
+/** Specific types of credentials
+ *
+ * username, password or file pointers are expected to be non zero. Use the
+ * empty string (ie. "") for and empty or unspecified value.
+ */
 
 /** Simple username/password pair credential kind.
  *

Index: subversion/include/svn_auth.h
===================================================================
--- subversion/include/svn_auth.h (revision 13396)
+++ subversion/include/svn_auth.h (working copy)
@@ -170,9 +170,11 @@
 /** @c SVN_AUTH_CRED_SIMPLE credentials. */
 typedef struct svn_auth_cred_simple_t
 {
- /** Username */
+ /** Username. Expected to be non zero. Use the empty string (ie. "") for
+ * and empty or unspecified username.
+ */
   const char *username;
- /** Password */
+ /** Password. Expected to be non zero. See above. */
   const char *password;
   /** Indicates if the credentials may be saved (to disk). For example, a
    * GUI prompt implementation with a remember password checkbox shall set

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 14 19:37:45 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.