[git] GnuPG - branch, master, updated. gnupg-2.1.2-89-g3f2bdac

by Werner Koch cvs at cvs.gnupg.org
Thu Apr 9 19:10:48 CEST 2015


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 "The GNU Privacy Guard".

The branch, master has been updated
       via  3f2bdac2f28e3cd31e2ecfc83573e91dff18c982 (commit)
       via  787cb8e261e775ae76496ae68344203e356d071b (commit)
       via  3fbeba64a8bfb2b673230c124a3d616b6568fd2f (commit)
      from  6619ead2cfd2abcb95b66dc70622fdeef624fb8a (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 3f2bdac2f28e3cd31e2ecfc83573e91dff18c982
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Apr 9 19:08:57 2015 +0200

    speedo: Fix libgpg-error build in w64 builds
    
    --
    
    This typo was recently introduced.

diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk
index 8a2053a..a0e29a5 100644
--- a/build-aux/speedo.mk
+++ b/build-aux/speedo.mk
@@ -206,7 +206,7 @@ endif
 # a full installer.
 speedo_w64_spkgs  =
 ifeq ($(WITH_GUI),1)
-speedo_w64_spkgs += ibgpg-error libiconv gettext libassuan gpgex
+speedo_w64_spkgs += libgpg-error libiconv gettext libassuan gpgex
 endif
 
 # Packages which use the gnupg autogen.sh build style

commit 787cb8e261e775ae76496ae68344203e356d071b
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Apr 9 19:07:21 2015 +0200

    tools: Remove trailing spaces.
    
    --

diff --git a/tools/gpgparsemail.c b/tools/gpgparsemail.c
index a8b3dc7..e142f3b 100644
--- a/tools/gpgparsemail.c
+++ b/tools/gpgparsemail.c
@@ -69,7 +69,7 @@ struct parse_info_s {
 
   char *signing_protocol;
   int hashing_level;           /* The nesting level we are hashing. */
-  int hashing;                 
+  int hashing;
   FILE *hash_file;
 
   FILE *sig_file;              /* Signature part with MIME or full
@@ -156,7 +156,7 @@ stpcpy (char *a,const char *b)
   while (*b)
     *a++ = *b++;
   *a = 0;
-  
+
   return (char*)a;
 }
 #endif
@@ -189,7 +189,7 @@ run_gnupg (int smime, int sig_fd, int data_fd, int *close_list)
           if (dup2 (sig_fd, 0) == -1)
             die ("dup2 stdin failed: %s", strerror (errno));
         }
-      
+
       /* Keep our data fd and format it for gpg/gpgsm use. */
       if (data_fd == -1)
         *data_fd_buf = 0;
@@ -205,7 +205,7 @@ run_gnupg (int smime, int sig_fd, int data_fd, int *close_list)
           if (dup2 (fd, 1) == -1)
             die ("dup2 stderr failed: %s", strerror (errno));
         }
-      
+
       /* Connect stderr to our pipe. */
       if (rp[1] != 2)
 	{
@@ -237,11 +237,11 @@ run_gnupg (int smime, int sig_fd, int data_fd, int *close_list)
                 "--",
                 "-", data_fd == -1? NULL : data_fd_buf,
                 NULL);
-      
+
       die ("failed to exec the crypto command: %s", strerror (errno));
     }
 
-  /* Parent. */ 
+  /* Parent. */
   close (rp[1]);
 
   fp = fdopen (rp[0], "r");
@@ -255,7 +255,7 @@ run_gnupg (int smime, int sig_fd, int data_fd, int *close_list)
     {
       if (pos < 9)
         status_buf[pos] = c;
-      else 
+      else
         {
           if (pos == 9)
             {
@@ -342,7 +342,7 @@ verify_signature (struct parse_info_s *info)
 
 
 
-/* Prepare for a multipart/signed. 
+/* Prepare for a multipart/signed.
    FIELD_CTX is the parsed context of the content-type header.*/
 static void
 mime_signed_begin (struct parse_info_s *info, rfc822parse_t msg,
@@ -387,7 +387,7 @@ mime_signed_begin (struct parse_info_s *info, rfc822parse_t msg,
 }
 
 
-/* Prepare for a multipart/encrypted. 
+/* Prepare for a multipart/encrypted.
    FIELD_CTX is the parsed context of the content-type header.*/
 static void
 mime_encrypted_begin (struct parse_info_s *info, rfc822parse_t msg,
@@ -410,7 +410,7 @@ pkcs7_begin (struct parse_info_s *info, rfc822parse_t msg,
              rfc822parse_field_t field_ctx)
 {
   const char *s;
-  
+
   (void)msg;
 
   s = rfc822parse_query_parameter (field_ctx, "name", 0);
@@ -509,7 +509,7 @@ message_cb (void *opaque, rfc822parse_event_t event, rfc822parse_t msg)
           s1 = rfc822parse_query_media_type (ctx, &s2);
           if (s1)
             {
-              printf ("h media: %*s%s %s\n", 
+              printf ("h media: %*s%s %s\n",
                       info->nesting_level*2, "", s1, s2);
               if (info->moss_state == 3)
                 {
@@ -549,7 +549,7 @@ message_cb (void *opaque, rfc822parse_event_t event, rfc822parse_t msg)
             }
           else
             printf ("h media: %*s none\n", info->nesting_level*2, "");
-              
+
           rfc822parse_release_field (ctx);
         }
       else
@@ -573,7 +573,7 @@ message_cb (void *opaque, rfc822parse_event_t event, rfc822parse_t msg)
       printf ("b up\n");
       if (info->nesting_level)
         info->nesting_level--;
-      else 
+      else
         err ("invalid structure (bad nesting level)");
     }
   else if (event == RFC822PARSE_BOUNDARY || event == RFC822PARSE_LAST_BOUNDARY)
@@ -586,7 +586,7 @@ message_cb (void *opaque, rfc822parse_event_t event, rfc822parse_t msg)
           info->skip_show = 1;
           printf ("b part\n");
         }
-      else 
+      else
         printf ("b last\n");
 
       if (info->moss_state == 2 && info->nesting_level == info->hashing_level)
@@ -648,7 +648,7 @@ parse_message (FILE *fp)
 
       if (rfc822parse_insert (msg, line, length))
 	die ("parser failed: %s", strerror (errno));
-      
+
       if (info.hashing)
         {
           /* Delay hashing of the CR/LF because the last line ending
@@ -689,7 +689,7 @@ parse_message (FILE *fp)
                 die ("error writing to temporary file: %s", strerror (errno));
             }
         }
-      
+
       if (info.show_boundary)
         {
           if (!opt_no_header)
@@ -727,11 +727,11 @@ parse_message (FILE *fp)
 }
 
 
-int 
+int
 main (int argc, char **argv)
 {
   int last_argc = -1;
- 
+
   if (argc)
     {
       argc--; argv++;
@@ -780,8 +780,8 @@ main (int argc, char **argv)
           opt_no_header = 1;
           argc--; argv++;
         }
-    }          
- 
+    }
+
   if (argc > 1)
     die ("usage: " PGM " [OPTION] [FILE] (try --help for more information)\n");
 

commit 3fbeba64a8bfb2b673230c124a3d616b6568fd2f
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Apr 9 19:06:33 2015 +0200

    gpgparsemail: Fix case of zero length continuation lines.
    
    * tools/rfc822parse.c (parse_field): Loop after continuation line.
    --
    
    Using header lines like
    
      Name:[lf]
      [space][lf]
      [lf]
    
    resulted in running into the "(s2 = strchr (delimiters2, *s)" branch
    and inserting a new token for the empty continuation line.  This also
    led to one byte read after the string which is what Hanno figured.
    The new code should handle empty continuation lines correct.
    
    Reported-by: Hanno Böck
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/rfc822parse.c b/tools/rfc822parse.c
index a70f6a4..e8164ce 100644
--- a/tools/rfc822parse.c
+++ b/tools/rfc822parse.c
@@ -808,10 +808,12 @@ parse_field (HDR_LINE hdr)
   s++; /* Move over the colon. */
   for (;;)
     {
-      if (!*s)
+      while (!*s)
 	{
 	  if (!hdr->next || !hdr->next->cont)
-	    break;
+            return tok; /* Ready.  */
+
+          /* Next item is a header continuation line.  */
 	  hdr = hdr->next;
 	  s = hdr->line;
 	}
@@ -824,10 +826,11 @@ parse_field (HDR_LINE hdr)
 	  invalid = 0;
 	  for (s++;; s++)
 	    {
-	      if (!*s)
+	      while (!*s)
 		{
 		  if (!hdr->next || !hdr->next->cont)
 		    break;
+                  /* Next item is a header continuation line.  */
 		  hdr = hdr->next;
 		  s = hdr->line;
 		}
@@ -880,6 +883,7 @@ parse_field (HDR_LINE hdr)
 
 	      if (*s2 || !hdr->next || !hdr->next->cont)
 		break;
+              /* Next item is a header continuation line.  */
 	      hdr = hdr->next;
 	      s = hdr->line;
 	    }
@@ -931,8 +935,7 @@ parse_field (HDR_LINE hdr)
 	  s++;
 	}
     }
-
-  return tok;
+  /*NOTREACHED*/
 
  failure:
   {

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

Summary of changes:
 build-aux/speedo.mk  |  2 +-
 tools/gpgparsemail.c | 40 ++++++++++++++++++++--------------------
 tools/rfc822parse.c  | 13 ++++++++-----
 3 files changed, 29 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list