serious bug in balsa 0.8.1 (fix included)



Hi,

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

Symptoms:
  * 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.

Fix:

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.

regards,
Jochen

== 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]