Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 281281 - mail-client/alpine-2.00: uninitialized pointer free()
Summary: mail-client/alpine-2.00: uninitialized pointer free()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-13 05:41 UTC by Alexander Prokofiev
Modified: 2009-08-17 18:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Prokofiev 2009-08-13 05:41:42 UTC
When using maildir-style mailbox, alpine crashes when unknown
files present in maildir (in my case, theese were some temp. files left from another program).
The reason - alpine tries to free uninitialized pointer.

CC: gcc-4.4.0
CFLAGS: -O2 -march=i686

Patch:
--- a/imap/src/osdep/unix/maildir.c     2009-08-13 09:26:50.000000000 +0400
+++ b/imap/src/osdep/unix/maildir.c     2009-08-13 09:23:02.000000000 +0400
@@ -1015,7 +1015,7 @@
 char *maildir_header (MAILSTREAM *stream,unsigned long msgno,
                unsigned long *length, long flags)
 {
-  char tmp[MAILTMPLEN], *s;
+  char tmp[MAILTMPLEN], *s = NULL;
   MESSAGECACHE *elt;
   static int try = 0;
Comment 1 Eduardo Chappa 2009-08-17 15:38:05 UTC
I can confirm the bug. The solution is correct, but the solution that will go in the official code will be different (remove the if(s) fs_give((void **)&s); statement that produces this crash).

The new modified patch is already updated.

Thank you for your report!

-- 
Eduardo
Comment 2 Torsten Veller (RETIRED) gentoo-dev 2009-08-17 18:52:01 UTC
alpine-2.00-r1 is in the tree now and contains chappa patches pl 51.

Thanks