mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
dirmngr: Fix out of scope use of a var in the keyserver LDAP code.
* dirmngr/ks-engine-ldap.c (extract_attributes): Don't use a variabale out of scope and cleanup the entire pgpKeySize block. -- GnuPG-bug-id: 4229 Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit 2b57a8159cdc3b212a4efc68787b40cafcd91ebe)
This commit is contained in:
parent
e53253485c
commit
26ebb15bec
@ -1694,26 +1694,16 @@ extract_attributes (LDAPMod ***modlist, char *line)
|
|||||||
|
|
||||||
if (is_pub || is_sub)
|
if (is_pub || is_sub)
|
||||||
{
|
{
|
||||||
char *size = fields[2];
|
char padded[6];
|
||||||
int val = atoi (size);
|
int val;
|
||||||
size = NULL;
|
|
||||||
|
|
||||||
if (val > 0)
|
val = atoi (fields[2]);
|
||||||
{
|
if (val < 99999 && val > 0)
|
||||||
/* We zero pad this on the left to make PGP happy. */
|
{
|
||||||
char padded[6];
|
/* We zero pad this on the left to make PGP happy. */
|
||||||
if (val < 99999 && val > 0)
|
snprintf (padded, sizeof padded, "%05u", val);
|
||||||
{
|
modlist_add (modlist, "pgpKeySize", padded);
|
||||||
snprintf (padded, sizeof padded, "%05u", val);
|
}
|
||||||
size = padded;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size)
|
|
||||||
{
|
|
||||||
if (is_pub || is_sub)
|
|
||||||
modlist_add (modlist, "pgpKeySize", size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_pub)
|
if (is_pub)
|
||||||
@ -1736,10 +1726,7 @@ extract_attributes (LDAPMod ***modlist, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (algo)
|
if (algo)
|
||||||
{
|
modlist_add (modlist, "pgpKeyType", algo);
|
||||||
if (is_pub)
|
|
||||||
modlist_add (modlist, "pgpKeyType", algo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_pub || is_sub || is_sig)
|
if (is_pub || is_sub || is_sig)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user