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: Mon, 20 Dec 2004 01:55:01 +0100

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

Modified Files:
        server.c 
Log Message:
Fix parse check.


--- /home/cvs/gsasl/lib/plain/server.c  2004/12/20 00:53:08     1.12
+++ /home/cvs/gsasl/lib/plain/server.c  2004/12/20 00:55:01     1.13
@@ -65,18 +65,18 @@
   if (passwordptr == NULL)
     return GSASL_MECHANISM_PARSE_ERROR;
 
+  /* As the NUL (U+0000) character is used as a deliminator, the NUL
+     (U+0000) character MUST NOT appear in authzid, authcid, or passwd
+     productions. */
+  if (memchr (passwordptr, 0, input_len - (passwordptr - input)))
+    return GSASL_MECHANISM_PARSE_ERROR;
+
   password = malloc (input_len - (passwordptr - input) + 1);
   if (password == NULL)
     return GSASL_MALLOC_ERROR;
   memcpy (password, passwordptr, input_len - (passwordptr - input));
   password[input_len - (passwordptr - input)] = '\0';
 
-  if (input_len - (passwordptr - input) != strlen (password))
-    {
-      free (password);
-      return GSASL_MECHANISM_PARSE_ERROR;
-    }
-
   gsasl_property_set (sctx, GSASL_AUTHID, authentication_id);
   gsasl_property_set (sctx, GSASL_AUTHZID, authorization_id);
   gsasl_property_set (sctx, GSASL_PASSWORD, password);





reply via email to

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