[svn] GnuPG - r5361 - branches/STABLE-BRANCH-2-0/g10

svn author wk cvs at cvs.gnupg.org
Fri Jun 18 10:08:50 CEST 2010


Author: wk
Date: 2010-06-18 10:08:49 +0200 (Fri, 18 Jun 2010)
New Revision: 5361

Modified:
   branches/STABLE-BRANCH-2-0/g10/ChangeLog
   branches/STABLE-BRANCH-2-0/g10/parse-packet.c
Log:
Backport bug fix.  Fixes bug#1240.  


Modified: branches/STABLE-BRANCH-2-0/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/ChangeLog	2010-06-18 08:08:21 UTC (rev 5360)
+++ branches/STABLE-BRANCH-2-0/g10/ChangeLog	2010-06-18 08:08:49 UTC (rev 5361)
@@ -1,3 +1,8 @@
+2010-06-18  Werner Koch  <wk at g10code.com>
+
+	* parse-packet.c (skip_packet, parse_gpg_control): Take care of
+	premature EOFs.  Backport from trunk.
+
 2010-06-17  Werner Koch  <wk at g10code.com>
 
 	* gpg.c (main): Use CAST5 as default s2k algo.  The macro

Modified: branches/STABLE-BRANCH-2-0/g10/parse-packet.c
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/parse-packet.c	2010-06-18 08:08:21 UTC (rev 5360)
+++ branches/STABLE-BRANCH-2-0/g10/parse-packet.c	2010-06-18 08:08:49 UTC (rev 5361)
@@ -682,7 +682,11 @@
 	  else
 	    {
 	      for( ; pktlen; pktlen-- )
-		dump_hex_line(iobuf_get(inp), &i);
+                {
+                  dump_hex_line ((c=iobuf_get(inp)), &i);
+                  if (c == -1)
+                    break;
+                }
 	    }
 	  putc ('\n', listfp);
 	  return;
@@ -2529,7 +2533,11 @@
         }
         else {
             for( ; pktlen; pktlen-- )
-                dump_hex_line(iobuf_get(inp), &i);
+              {
+                dump_hex_line ((c=iobuf_get (inp)), &i);
+                if (c == -1)
+                  break;
+              }
         }
         putc ('\n', listfp);
     }





More information about the Gnupg-commits mailing list