[Bug 662216] New: [PATCH] mutt: crash in make_sidebar_entry
https://bugzilla.novell.com/show_bug.cgi?id=662216 https://bugzilla.novell.com/show_bug.cgi?id=662216#c0 Summary: [PATCH] mutt: crash in make_sidebar_entry Classification: openSUSE Product: openSUSE 11.4 Version: Factory Platform: Other OS/Version: Other Status: NEW Severity: Critical Priority: P5 - None Component: Other AssignedTo: werner@novell.com ReportedBy: mvyskocil@novell.com QAContact: qa@suse.de Found By: Development Blocker: --- The sidebar patch contains a bug in function draw_sidebar. The mutt crashes with following trace #0 0x00007ff365736ad5 in raise () from /lib64/libc.so.6 #1 0x00007ff365737fd6 in abort () from /lib64/libc.so.6 #2 0x00007ff365771df3 in __libc_message () from /lib64/libc.so.6 #3 0x00007ff3657773d6 in malloc_printerr () from /lib64/libc.so.6 #4 0x00007ff36577b0d5 in realloc_check () from /lib64/libc.so.6 #5 0x0000000000473fa3 in make_sidebar_entry (box=0x8584b5 "INBOX.Drafts", size=0, new=0, flagged=0) at sidebar.c:90 #6 0x0000000000474590 in draw_sidebar (menu=6) at sidebar.c:268 #7 0x00000000004208a2 in mutt_index_menu () at curs_main.c:554 #8 0x000000000043ce07 in main (argc=1, argv=<value optimized out>) at main.c:1026 The crash is because draw_sidebar free a char buffer, which is reallocated in make_sidebar_entry afterwards. Fix is simple - do not free this entry buffer, it's only reallocated, so no memory will be lost. $ cat mutt-1.5.21-sidebar-realloc-crash.patch --- sidebar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Index: mutt-1.5.21/sidebar.c =================================================================== --- mutt-1.5.21.orig/sidebar.c 2011-01-04 11:38:39.365556621 +0100 +++ mutt-1.5.21/sidebar.c 2011-01-04 11:39:25.099393197 +0100 @@ -268,8 +268,6 @@ printw( "%.*s", SidebarWidth - delim_len + 1, make_sidebar_entry(sidebar_folder_name, tmp->msgcount, tmp->msg_unread, tmp->msg_flagged)); - if (sidebar_folder_depth > 0) - free(sidebar_folder_name); lines++; } SETCOLOR(MT_COLOR_NORMAL); -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c1
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c2
--- Comment #2 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c3
--- Comment #3 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c4
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c5
--- Comment #5 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c6
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c7
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c8
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c9
--- Comment #9 from Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c10
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c11
--- Comment #11 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c12
--- Comment #12 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c13
--- Comment #13 from Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c14
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c15
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c16
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c17
--- Comment #17 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c18
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c19
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c20
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c21
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c22
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c23
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c24
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c25
--- Comment #25 from Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=662216
https://bugzilla.novell.com/show_bug.cgi?id=662216#c26
Dr. Werner Fink
participants (1)
-
bugzilla_noreply@novell.com