gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/lib/plain


From: gsasl-commit
Subject: CVS gsasl/lib/plain
Date: Thu, 30 Sep 2004 15:49:13 +0200

Update of /home/cvs/gsasl/lib/plain
In directory dopio:/tmp/cvs-serv25328

Modified Files:
        client.c 
Log Message:
Don't fail on missing authzid.


--- /home/cvs/gsasl/lib/plain/client.c  2004/09/24 01:37:14     1.6
+++ /home/cvs/gsasl/lib/plain/client.c  2004/09/30 13:49:13     1.7
@@ -45,19 +45,18 @@
   int res;
 
   p = gsasl_property_get (sctx, GSASL_AUTHZID);
-  if (!p)
+  if (p)
     {
-      res = GSASL_NO_AUTHZID;
-      goto end;
-    }
-
-  authzid = gsasl_stringprep_nfkc (p, -1);
-  if (authzid == NULL)
-    {
-      res = GSASL_UNICODE_NORMALIZATION_ERROR;
-      goto end;
+      authzid = gsasl_stringprep_nfkc (p, -1);
+      if (authzid == NULL)
+       {
+         res = GSASL_UNICODE_NORMALIZATION_ERROR;
+         goto end;
+       }
+      authzidlen = strlen (authzid);
     }
-  authzidlen = strlen (authzid);
+  else
+    authzidlen = 0;
 
   p = gsasl_property_get (sctx, GSASL_AUTHID);
   if (!p)
@@ -97,7 +96,8 @@
       goto end;
     }
 
-  memcpy (*output, authzid, authzidlen);
+  if (authzid > 0)
+    memcpy (*output, authzid, authzidlen);
   (*output)[authzidlen] = '\0';
   memcpy (*output + authzidlen + 1, authid, authidlen);
   (*output)[authzidlen + 1 + authidlen] = '\0';





reply via email to

[Prev in Thread] Current Thread [Next in Thread]