gsasl-commit
[Top][All Lists]
Advanced

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

CVS gsasl/lib/src


From: gsasl-commit
Subject: CVS gsasl/lib/src
Date: Sun, 28 Nov 2004 05:17:49 +0100

Update of /home/cvs/gsasl/lib/src
In directory dopio:/tmp/cvs-serv2717

Modified Files:
        base64.c 
Log Message:
Use new API.


--- /home/cvs/gsasl/lib/src/base64.c    2004/11/27 03:31:06     1.3
+++ /home/cvs/gsasl/lib/src/base64.c    2004/11/28 04:17:49     1.4
@@ -23,9 +23,6 @@
 
 #include "base64.h"
 
-/* Get SIZE_MAX.  */
-#include "xsize.h"
-
 /**
  * gsasl_base64_to:
  * @in: input byte array
@@ -72,6 +69,13 @@
 int
 gsasl_base64_from (const char *in, size_t inlen, char **out, size_t * outlen)
 {
-  return base64_decode_alloc (in, inlen, out, outlen)
-    ? GSASL_OK : GSASL_MALLOC_ERROR;
+  int ok = base64_decode_alloc (in, inlen, out, outlen);
+
+  if (!ok)
+    return GSASL_BASE64_ERROR;
+
+  if (*out == NULL || *outlen == SIZE_MAX)
+    return GSASL_MALLOC_ERROR;
+
+  return GSASL_OK;
 }





reply via email to

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