summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-05-14 04:20:07 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2019-05-14 04:20:07 +0200
commit802a2aa300bad3d4385d17a2deeb0966da4e737d (patch)
treeacfec02ff53487c35523a439b7d1b06b683ac57b /g10
parentgpg: Change update_keysig_packet to replace SHA-1 by SHA-256. (diff)
downloadgnupg2-802a2aa300bad3d4385d17a2deeb0966da4e737d.tar.xz
gnupg2-802a2aa300bad3d4385d17a2deeb0966da4e737d.zip
g10: Fix possible null dereference.
* g10/armor.c (armor_filter): Access ->d in the internal loop. -- GnuPG-bug-id: 4494 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10')
-rw-r--r--g10/armor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/g10/armor.c b/g10/armor.c
index 972766503..eb2d28bca 100644
--- a/g10/armor.c
+++ b/g10/armor.c
@@ -1394,10 +1394,10 @@ armor_filter( void *opaque, int control,
}
/* write the comment strings */
- for(s=comment->d;comment;comment=comment->next,s=comment->d)
+ for(;comment;comment=comment->next)
{
iobuf_writestr(a, "Comment: " );
- for( ; *s; s++ )
+ for( s=comment->d; *s; s++ )
{
if( *s == '\n' )
iobuf_writestr(a, "\\n" );