[svn] GnuPG - r5360 - branches/STABLE-BRANCH-1-4/g10

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


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

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


Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/ChangeLog	2010-06-17 15:44:44 UTC (rev 5359)
+++ branches/STABLE-BRANCH-1-4/g10/ChangeLog	2010-06-18 08:08:21 UTC (rev 5360)
@@ -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-01  Werner Koch  <wk at g10code.com>
 
 	* gpg.c (main): Add dummy option --debug-level and ignore

Modified: branches/STABLE-BRANCH-1-4/g10/parse-packet.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/parse-packet.c	2010-06-17 15:44:44 UTC (rev 5359)
+++ branches/STABLE-BRANCH-1-4/g10/parse-packet.c	2010-06-18 08:08:21 UTC (rev 5360)
@@ -622,7 +622,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;
@@ -2441,7 +2445,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