core: Do not identify PNG files as PGP signatures.
* src/data-identify.c (next_openpgp_packet): Blacklist PNG files. -- GnuPG-bug-id: 2314 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
09667a6006
commit
a9168185ba
@ -95,6 +95,11 @@ next_openpgp_packet (unsigned char const **bufptr, size_t *buflen,
|
|||||||
if (!len)
|
if (!len)
|
||||||
return gpg_error (GPG_ERR_NO_DATA);
|
return gpg_error (GPG_ERR_NO_DATA);
|
||||||
|
|
||||||
|
/* First some blacklisting. */
|
||||||
|
if (len >= 4 && !memcmp (buf, "\x89PNG", 4))
|
||||||
|
return gpg_error (GPG_ERR_INV_PACKET); /* This is a PNG file. */
|
||||||
|
|
||||||
|
/* Start parsing. */
|
||||||
ctb = *buf++; len--;
|
ctb = *buf++; len--;
|
||||||
if ( !(ctb & 0x80) )
|
if ( !(ctb & 0x80) )
|
||||||
return gpg_error (GPG_ERR_INV_PACKET); /* Invalid CTB. */
|
return gpg_error (GPG_ERR_INV_PACKET); /* Invalid CTB. */
|
||||||
|
Loading…
Reference in New Issue
Block a user