[git] GPG-ERROR - branch, master, updated. libgpg-error-1.27-5-ga8d267a

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed Apr 19 06:34:51 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Error codes used by GnuPG et al.".

The branch, master has been updated
       via  a8d267a7220399f7acf69723fe1d31efd2160319 (commit)
      from  5e51b642f747547c737a7abbc37e65b0f630d188 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a8d267a7220399f7acf69723fe1d31efd2160319
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Apr 19 13:32:36 2017 +0900

    Minor clean up.
    
    * src/b64dec.c (_gpgrt_b64dec_proc): Add a comment.
    * src/estream.c (_gpgrt_fread, _gpgrt_fwrite): Use &&.
    * src/mkheader.c (xstrdup): Use memcpy as we know length.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/src/b64dec.c b/src/b64dec.c
index d846a6a..a8a8351 100644
--- a/src/b64dec.c
+++ b/src/b64dec.c
@@ -140,6 +140,7 @@ _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
           break;
         case s_init:
           ds = s_lfseen;
+          /* Fall through */
         case s_lfseen:
           if (*s != "-----BEGIN "[pos])
             {
diff --git a/src/estream.c b/src/estream.c
index 9f227a6..066fe02 100644
--- a/src/estream.c
+++ b/src/estream.c
@@ -4179,7 +4179,7 @@ _gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
 {
   size_t ret, bytes;
 
-  if (size * nitems)
+  if (size && nitems)
     {
       lock_stream (stream);
       es_readn (stream, ptr, size * nitems, &bytes);
@@ -4200,7 +4200,7 @@ _gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
 {
   size_t ret, bytes;
 
-  if (size * nitems)
+  if (size && nitems)
     {
       lock_stream (stream);
       es_writen (stream, ptr, size * nitems, &bytes);
diff --git a/src/mkheader.c b/src/mkheader.c
index 5aeb1e7..997cab5 100644
--- a/src/mkheader.c
+++ b/src/mkheader.c
@@ -52,14 +52,15 @@ static char *
 xstrdup (const char *string)
 {
   char *p;
+  size_t len = strlen (string) + 1;
 
-  p = malloc (strlen (string)+1);
+  p = malloc (len);
   if (!p)
     {
       fputs (PGM ": out of core\n", stderr);
       exit (1);
     }
-  strcpy (p, string);
+  memcpy (p, string, len);
   return p;
 }
 

-----------------------------------------------------------------------

Summary of changes:
 src/b64dec.c   | 1 +
 src/estream.c  | 4 ++--
 src/mkheader.c | 5 +++--
 3 files changed, 6 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Error codes used by GnuPG et al.
http://git.gnupg.org




More information about the Gnupg-commits mailing list