1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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>
This commit is contained in:
NIIBE Yutaka 2019-05-14 11:20:07 +09:00
parent 484d6ba589
commit 802a2aa300

View File

@ -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" );