serious bug in balsa 0.8.1 (fix included)


I have found and fixed a very serious bug in Balsa version 0.8.1.

  * fetching POP3 mails does not work.
  * balsa creates files with very strange names in my home directory
    (which contain the new mail, but are not found again by balsa).

Location of the problem:

The program accesses dynamically allocated memory after it is freed:
The function `do_load_mailboxes' in file "src/balsa-app.c" allocates
memory for the variable `spool'.  Then it calls `mailbox_init' from
"libbalsa/mailbox.c", which keeps a copy of the pointer: this happens
in the line
    Spoolfile = inbox_path;
Afterward the function `do_load_mailboxes' frees this memory.
So `Spoolfile' points to invalid data.


A quick hack to fix the problem is to copy the string in
`mailbox_init'.  This will produce a minor memory leak, but at least
makes balsa work.  I have appended a patch to achive this.


== patch begins at the next line =====================================
diff -ur balsa-0.8.1.orig/libbalsa/mailbox.c balsa-0.8.1/libbalsa/mailbox.c
--- balsa-0.8.1.orig/libbalsa/mailbox.c	Mon Jun 12 14:43:40 2000
+++ balsa-0.8.1/libbalsa/mailbox.c	Thu Jul 13 14:25:13 2000
@@ -114,7 +114,7 @@
   update_gui_func = gui_func;
-  Spoolfile = inbox_path;
+  Spoolfile = g_strdup (inbox_path);
   uname (&utsname);
== patch ends at previous line =======================================

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]