mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* 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.
This commit is contained in:
parent
05277262bc
commit
006c5af165
3 changed files with 10 additions and 3 deletions
|
@ -1589,11 +1589,11 @@ read_protected_v3_mpi (IOBUF inp, unsigned long *length)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue