Bug 723 - bus errors
: bus errors
Status: RESOLVED FIXED
: Sylpheed-Claws (GTK1)
Plugins/PGPMime
: 1.0.4
: Sun NetBSD
: P3 blocker
Assigned To:
:
:
:
  Show dependency treegraph
 
Reported: 2005-04-14 21:10 by
Modified: 2005-04-15 19:36 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-04-14 21:10:24
Symptoms: sylpheed crashes with a bus error when trying to sign or encrypt a
message.

The reason: in pgpmime.c /  pgpmime_sign() and pgpmime_encrypt() there's a
variable len declared as guint - 32bit but a pointer to it is passed as &size_t
which is 64bit, at least on NetBSD. This will crash and burn when running as a
64bit process on any platform that requires natural alignment, like most RISCs.

Fix: just make them size_t or gsize.
------- Comment #1 From 2005-04-14 21:16:25 -------
Could you provide an exact location, or a perhaps better, a patch?
------- Comment #2 From 2005-04-14 21:23:34 -------
Just this pseudopatch:

503:
gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
{
 MimeInfo *msgcontent, *encmultipart, *newinfo;
 FILE *fp;
 gchar *boundary, *enccontent;
- guint len;
+ size_t len;
 gchar *textstr;
 GpgmeData gpgtext, gpgenc;
 gchar **recipients, **nextrecp;
 GpgmeRecipients recp;
 GpgmeCtx ctx;

412:
gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account)
{
 MimeInfo *msgcontent, *sigmultipart, *newinfo;
 gchar *textstr, *opinfo, *micalg;
 FILE *fp;
 gchar *boundary, *sigcontent;
 GpgmeCtx ctx;
 GpgmeData gpgtext, gpgsig;
- guint len;
+ size_t len;
 struct passphrase_cb_info_s info;
------- Comment #3 From 2005-04-15 19:36:12 -------
Fixed in 1.9.6cvs36
------- Comment #4 From 2005-04-15 19:36:40 -------
(and fixed in pgpinline plugin, while we're at it).