From 802a2aa300bad3d4385d17a2deeb0966da4e737d Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 14 May 2019 11:20:07 +0900 Subject: [PATCH] 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 --- g10/armor.c | 4 ++-- 1 file 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" );