mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Fix use of uninit.value in listing sig subpkts.
* g10/parse-packet.c (dump_sig_subpkt): Print regex subpacket
sanitized.
--
We may not use "%s" to print an arbitrary buffer. At least "%.*s"
should have been used. However, it is in general preferable to escape
control characters while printf user data.
Reported-by: Hanno Böck
Signed-off-by: Werner Koch <wk@gnupg.org>
(backported from commit 596ae9f543
)
This commit is contained in:
parent
2b4809406b
commit
2d359681f0
1 changed files with 7 additions and 2 deletions
|
@ -892,13 +892,18 @@ dump_sig_subpkt( int hashed, int type, int critical,
|
|||
if(length!=2)
|
||||
p="[invalid trust subpacket]";
|
||||
else
|
||||
fprintf (listfp, "trust signature of depth %d, value %d",buffer[0],buffer[1]);
|
||||
fprintf (listfp, "trust signature of depth %d, value %d",
|
||||
buffer[0],buffer[1]);
|
||||
break;
|
||||
case SIGSUBPKT_REGEXP:
|
||||
if(!length)
|
||||
p="[invalid regexp subpacket]";
|
||||
else
|
||||
fprintf (listfp, "regular expression: \"%s\"",buffer);
|
||||
{
|
||||
fprintf (listfp, "regular expression: \"");
|
||||
print_string (listfp, buffer, length, '\"');
|
||||
p = "\"";
|
||||
}
|
||||
break;
|
||||
case SIGSUBPKT_REVOCABLE:
|
||||
if( length )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue