[svn] GnuPG - r4401 - trunk/g10
svn author wk
cvs at cvs.gnupg.org
Mon Jan 15 20:31:26 CET 2007
Author: wk
Date: 2007-01-15 20:31:24 +0100 (Mon, 15 Jan 2007)
New Revision: 4401
Modified:
trunk/g10/ChangeLog
trunk/g10/keygen.c
trunk/g10/parse-packet.c
Log:
* parse-packet.c (read_protected_v3_mpi): Make sure to stop
reading even for corrupted packets.
* keygen.c (generate_user_id): Need to allocate one byte more.
Reported by Felix von Leitner.
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2007-01-15 19:30:33 UTC (rev 4400)
+++ trunk/g10/ChangeLog 2007-01-15 19:31:24 UTC (rev 4401)
@@ -1,3 +1,10 @@
+2007-01-15 Werner Koch <wk at g10code.com>
+
+ * parse-packet.c (read_protected_v3_mpi): Make sure to stop
+ reading even for corrupted packets.
+ * keygen.c (generate_user_id): Need to allocate one byte more.
+ Reported by Felix von Leitner.
+
2006-12-21 Werner Koch <wk at g10code.com>
* gpg.c (main): New command --server.
Modified: trunk/g10/keygen.c
===================================================================
--- trunk/g10/keygen.c 2007-01-15 19:30:33 UTC (rev 4400)
+++ trunk/g10/keygen.c 2007-01-15 19:31:24 UTC (rev 4401)
@@ -2130,7 +2130,7 @@
if( !p )
return NULL;
n = strlen(p);
- uid = xmalloc_clear( sizeof *uid + n - 1 );
+ uid = xmalloc_clear( sizeof *uid + n );
uid->len = n;
strcpy(uid->name, p);
uid->ref = 1;
Modified: trunk/g10/parse-packet.c
===================================================================
--- trunk/g10/parse-packet.c 2007-01-15 19:30:33 UTC (rev 4400)
+++ trunk/g10/parse-packet.c 2007-01-15 19:31:24 UTC (rev 4401)
@@ -1589,11 +1589,11 @@
buf = p = xmalloc (2 + nbytes);
*p++ = nbits >> 8;
*p++ = nbits;
- for (; nbytes && length; nbytes--, --*length)
+ for (; nbytes && *length; nbytes--, --*length)
*p++ = iobuf_get (inp);
if (nbytes)
{
- log_error ("packet shorter tham mpi\n");
+ log_error ("packet shorter than mpi\n");
xfree (buf);
return NULL;
}
More information about the Gnupg-commits
mailing list