mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpg: Fix first zero-byte case for SOS handling.
* g10/export.c (transfer_format_to_openpgp): Check the first byte. * g10/pkglue.c (sexp_extract_param_sos): Likewise. -- GnuPG-bug-id: 5116 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
243f9176e7
commit
dd4fb1c8f6
@ -985,7 +985,7 @@ transfer_format_to_openpgp (gcry_sexp_t s_pgp, PKT_public_key *pk)
|
||||
unsigned int nbits = valuelen*8;
|
||||
const unsigned char *p = value;
|
||||
|
||||
if (nbits >= 8 && !(*p & 0x80))
|
||||
if (*p && nbits >= 8 && !(*p & 0x80))
|
||||
if (--nbits >= 7 && !(*p & 0x40))
|
||||
if (--nbits >= 6 && !(*p & 0x20))
|
||||
if (--nbits >= 5 && !(*p & 0x10))
|
||||
|
@ -71,7 +71,7 @@ sexp_extract_param_sos (gcry_sexp_t sexp, const char *param, gcry_mpi_t *r_sos)
|
||||
unsigned int nbits = buflen*8;
|
||||
unsigned char *p = p0;
|
||||
|
||||
if (nbits >= 8 && !(*p & 0x80))
|
||||
if (*p && nbits >= 8 && !(*p & 0x80))
|
||||
if (--nbits >= 7 && !(*p & 0x40))
|
||||
if (--nbits >= 6 && !(*p & 0x20))
|
||||
if (--nbits >= 5 && !(*p & 0x10))
|
||||
|
Loading…
x
Reference in New Issue
Block a user