mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
gpg: Fix possible segv when attribute packets are filtered.
* g10/import.c (impex_filter_getval): Handle PKT_ATTRIBUTE the same as PKT_USER_ID (apply_drop_sig_filter): Ditto. -- The old code was plainly wrong in that it considered PKT_ATTRIBUTE to use a PKT_signature object. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
1813f3be23
commit
5f6f3f5cae
12
g10/import.c
12
g10/import.c
@ -1173,7 +1173,8 @@ impex_filter_getval (void *cookie, const char *propname)
|
|||||||
static char numbuf[20];
|
static char numbuf[20];
|
||||||
const char *result;
|
const char *result;
|
||||||
|
|
||||||
if (node->pkt->pkttype == PKT_USER_ID)
|
if (node->pkt->pkttype == PKT_USER_ID
|
||||||
|
|| node->pkt->pkttype == PKT_ATTRIBUTE)
|
||||||
{
|
{
|
||||||
PKT_user_id *uid = node->pkt->pkt.user_id;
|
PKT_user_id *uid = node->pkt->pkt.user_id;
|
||||||
|
|
||||||
@ -1202,8 +1203,7 @@ impex_filter_getval (void *cookie, const char *propname)
|
|||||||
else
|
else
|
||||||
result = NULL;
|
result = NULL;
|
||||||
}
|
}
|
||||||
else if (node->pkt->pkttype == PKT_SIGNATURE
|
else if (node->pkt->pkttype == PKT_SIGNATURE)
|
||||||
|| node->pkt->pkttype == PKT_ATTRIBUTE)
|
|
||||||
{
|
{
|
||||||
PKT_signature *sig = node->pkt->pkt.signature;
|
PKT_signature *sig = node->pkt->pkt.signature;
|
||||||
|
|
||||||
@ -1340,12 +1340,12 @@ apply_drop_sig_filter (kbnode_t keyblock, recsel_expr_t selector)
|
|||||||
if (node->pkt->pkttype == PKT_PUBLIC_SUBKEY
|
if (node->pkt->pkttype == PKT_PUBLIC_SUBKEY
|
||||||
|| node->pkt->pkttype == PKT_SECRET_SUBKEY)
|
|| node->pkt->pkttype == PKT_SECRET_SUBKEY)
|
||||||
break; /* ready. */
|
break; /* ready. */
|
||||||
if (node->pkt->pkttype == PKT_USER_ID)
|
if (node->pkt->pkttype == PKT_USER_ID
|
||||||
|
|| node->pkt->pkttype == PKT_ATTRIBUTE)
|
||||||
active = 1;
|
active = 1;
|
||||||
if (!active)
|
if (!active)
|
||||||
continue;
|
continue;
|
||||||
if (node->pkt->pkttype != PKT_SIGNATURE
|
if (node->pkt->pkttype != PKT_SIGNATURE)
|
||||||
&& node->pkt->pkttype != PKT_ATTRIBUTE)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sig = node->pkt->pkt.signature;
|
sig = node->pkt->pkt.signature;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user