gsasl-commit
[Top][All Lists]
Advanced

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

CVS gsasl/lib/gl


From: gsasl-commit
Subject: CVS gsasl/lib/gl
Date: Thu, 6 Oct 2005 17:57:48 +0200

Update of /home/cvs/gsasl/lib/gl
In directory dopio:/tmp/cvs-serv23553/gl

Modified Files:
        gc-gnulib.c gc-libgcrypt.c getdelim.c memxor.c 
Log Message:
Update.

--- /home/cvs/gsasl/lib/gl/gc-gnulib.c  2005/10/05 14:52:30     1.2
+++ /home/cvs/gsasl/lib/gl/gc-gnulib.c  2005/10/06 15:57:48     1.3
@@ -1,28 +1,26 @@
 /* gc-gl-common.c --- Common gnulib internal crypto interface functions
  * Copyright (C) 2002, 2003, 2004, 2005  Simon Josefsson
  *
- * This file is part of GC.
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1, or (at your
+ * option) any later version.
  *
- * GC is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
  *
- * GC is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
- * Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License License along with GC; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this file; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
  *
  */
 
 /* Note: This file is only built if GC uses internal functions. */
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
 
@@ -36,6 +34,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <errno.h>
 
 #include <string.h>
 
@@ -87,7 +86,12 @@
       tmp = read (fd, data, datalen);
 
       if (tmp < 0)
-       return GC_RANDOM_ERROR;
+       {
+         int save_errno = errno;
+         close (fd);
+         errno = save_errno;
+         return GC_RANDOM_ERROR;
+       }
 
       len += tmp;
     }
--- /home/cvs/gsasl/lib/gl/gc-libgcrypt.c       2005/10/05 14:30:08     1.1
+++ /home/cvs/gsasl/lib/gl/gc-libgcrypt.c       2005/10/06 15:57:48     1.2
@@ -20,7 +20,7 @@
 
 /* Note: This file is only built if GC uses Libgcrypt. */
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
 
@@ -114,7 +114,10 @@
 
   p = gcry_md_read (hd, GCRY_MD_MD5);
   if (p == NULL)
-    return GC_INVALID_HASH;
+    {
+      gcry_md_close (mdh);
+      return GC_INVALID_HASH;
+    }
 
   memcpy (resbuf, p, outlen);
 
@@ -140,13 +143,19 @@
 
   err = gcry_md_setkey (mdh, key, keylen);
   if (err != GPG_ERR_NO_ERROR)
-    return GC_INVALID_HASH;
+    {
+      gcry_md_close (mdh);
+      return GC_INVALID_HASH;
+    }
 
   gcry_md_write (mdh, in, inlen);
 
   hash = gcry_md_read (mdh, GCRY_MD_MD5);
   if (hash == NULL)
-    return GC_INVALID_HASH;
+    {
+      gcry_md_close (mdh);
+      return GC_INVALID_HASH;
+    }
 
   memcpy (resbuf, hash, hlen);
 
--- /home/cvs/gsasl/lib/gl/getdelim.c   2005/10/05 09:18:02     1.7
+++ /home/cvs/gsasl/lib/gl/getdelim.c   2005/10/06 15:57:48     1.8
@@ -29,6 +29,9 @@
 #include <stdlib.h>
 #include <errno.h>
 
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
 #ifndef SSIZE_MAX
 # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
 #endif
--- /home/cvs/gsasl/lib/gl/memxor.c     2005/10/05 15:05:00     1.2
+++ /home/cvs/gsasl/lib/gl/memxor.c     2005/10/06 15:57:48     1.3
@@ -27,10 +27,11 @@
 void *
 memxor (void *restrict dest, const void *restrict src, size_t n)
 {
+  char const *s = src;
   char *d = dest;
 
   for (; n > 0; n--)
-    *(char*)d++ ^= *(char*)src++;
+    *d++ ^= *s++;
 
   return dest;
 }





reply via email to

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