Bug in cryptplug

Ingo Klöcker kloecker@kde.org
Mon Jun 16 13:27:02 2003


--Boundary-02=_UiP7+eiQqWQjHbI
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,

while trying to find out why kgpgcertmanager crashes=20
(http://bugs.kde.org/show_bug.cgi?id=3D59762) I found a bug in=20
cryptplug/gpgme/gpgmeplug.c. The following patch fixes the problem that=20
the cryptplug crashed because it->info wasn't initialized when=20
endListCertificates was called.

BTW, the crash occurred because gpgme_op_keylist_ext_start returned 22=20
(=3D=3D GPGME_Invalid_Engine). What does this mean?

Index: gpgmeplug.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/aegypten/cryptplug/gpgme/gpgmeplug.c,v
retrieving revision 1.2.2.5
diff -u -3 -p -r1.2.2.5 gpgmeplug.c
=2D-- gpgmeplug.c 4 May 2003 17:42:36 -0000       1.2.2.5
+++ gpgmeplug.c 15 Jun 2003 22:41:16 -0000
@@ -2137,12 +2137,12 @@ startListCertificates( const char* patte
     if( remote ) gpgme_set_keylist_mode ( it->ctx,=20
GPGME_KEYLIST_MODE_EXTERN );
     else gpgme_set_keylist_mode ( it->ctx, GPGME_KEYLIST_MODE_LOCAL );
     err =3D  gpgme_op_keylist_ext_start ( it->ctx, patterns, 0, 0);
+    memset( &(it->info), 0, sizeof( struct CertificateInfo ) );
     if( err !=3D GPGME_No_Error ) {
       fprintf( stderr,  "gpgme_op_keylist_ext_start returned %d", err=20
);
       endListCertificates( it );
       return NULL;
     }
=2D    memset( &(it->info), 0, sizeof( struct CertificateInfo ) );
     return it;
 }

=3D=3D=3D=3D=3D

Regards,
Ingo


--Boundary-02=_UiP7+eiQqWQjHbI
Content-Type: application/pgp-signature
Content-Description: signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQA+7PiUGnR+RTDgudgRAu7ZAKC5FEjiHM+bboDz4SAUiD09Oyv4YQCgqGeW
q75PEMvPLxt6Agr2OSM+c5U=
=Olgn
-----END PGP SIGNATURE-----

--Boundary-02=_UiP7+eiQqWQjHbI--