diff options
author | NIIBE Yutaka <[email protected]> | 2019-05-14 02:20:07 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2019-05-14 02:24:35 +0000 |
commit | 5b22d2c400890fc366ccb7ca74ee886d9cef22a3 (patch) | |
tree | 60c42921cdcfe5dc5688a38a2d60cba58ccfc50d | |
parent | build: Update m4/iconv.m4. (diff) | |
download | gnupg-5b22d2c400890fc366ccb7ca74ee886d9cef22a3.tar.gz gnupg-5b22d2c400890fc366ccb7ca74ee886d9cef22a3.zip |
g10: Fix possible null dereference.
* g10/armor.c (armor_filter): Access ->d in the internal loop.
--
Cherry-picked master commit of:
802a2aa300bad3d4385d17a2deeb0966da4e737d
GnuPG-bug-id: 4494
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r-- | g10/armor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/g10/armor.c b/g10/armor.c index cc8096862..36215a33e 100644 --- a/g10/armor.c +++ b/g10/armor.c @@ -1156,10 +1156,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" ); |