[Users] [Bug 2650] New: segfault in pgp when gpgme_strerror() returns a non utf-8 string

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Sun Apr 15 22:32:40 CEST 2012


http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=2650

           Summary: segfault in pgp when gpgme_strerror() returns a non
                    utf-8 string
           Product: Claws Mail
           Version: 3.8.0
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Plugins/Privacy
        AssignedTo: users at lists.claws-mail.org
        ReportedBy: patfbsd at davenulle.org


(FreeBSD9 / Claws-mail 3.8.0 / gpgme-1.3.1 / gnupg-2.0.19)

Hello,

When gpgme_strerror() returns a non utf-8 string, this string makes claws-mail
to crash latter, when the string is outputed by the glib function
g_markup_escape_text().

This happens if the locale used is not UTF-8 (I use fr_FR.ISO8859-15), gpgme
uses the current locale but glib seems to require good UTF-8.
Example when reading a SMIME mail that fails with the gpgme error "protocole
non supporté".

----
gdb
....
imap.c:1425:message 9262 has been already fully cached.
    message/rfc822 (offset:0 length:15214 encoding: 6)
        multipart/signed (offset:4109 length:11105 encoding: 6)
            multipart/alternative (offset:4301 length:4678 encoding: 6)
                text/plain (offset:4490 length:1672 encoding: 3)
                text/html (offset:6291 length:2646 encoding: 3)
            application/pkcs7-signature (offset:9224 length:5946 encoding: 4)
mimeview.c:515:signed mail
smime.c:203:Checking S/MIME signature
sgpgme.c:386:tmp file /home/patrick/.claws-mail/tmp/tmpfile.00000000
sgpgme.c:392:data 0x7fffffffa3b0 (9224 5946)
sgpgme.c:72:[Invalid UTF-8] op_verify err Protocole non support\xe9
sgpgme.c:91:system error

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 80ac07400 (LWP 100510/claws-mail)]
0x000000080828a740 in g_markup_escape_text () from
/usr/local/lib/libglib-2.0.so.0
------

Note the 'Invalid UTF-8' and the error message in ISO-8859-15. The code is:

src/plugins/pgpcore/sgpgme.c
-------
    65 gpgme_verify_result_t sgpgme_verify_signature(gpgme_ctx_t ctx,
gpgme_data_t sig, 
     66                                         gpgme_data_t plain,
gpgme_data_t dummy)
     67 {
     68         gpgme_verify_result_t status = NULL;
     69         gpgme_error_t err;
     70 
     71         if ((err = gpgme_op_verify(ctx, sig, plain, dummy)) !=
GPG_ERR_NO_ERROR) {
===> 72                 debug_print("op_verify err %s\n", gpgme_strerror(err));
     73                 privacy_set_error("%s", gpgme_strerror(err));
     74                 return GINT_TO_POINTER(-GPG_ERR_SYSTEM_ERROR);
     75         }
--------

A workaround here is to start claws-mail with locale set to UTF-8.

Fix:
----
I don't have a fix to suggest, but this
http://mail.gnome.org/archives/balsa-list/2007-March/msg00000.html is similar
to this problem and might help.

Best regards.

-- 
Configure bugmail: http://www.thewildbeast.co.uk/claws-mail/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Users mailing list