Begin forwarded message:

Date: Tue, 17 Apr 2007 18:25:52 -0400
From: Brad <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: patch to fix a crashing issue with libetpan when using IMAP.


Here is a diff I copied from the libetpan CVS repo which fixes a crash
when using IMAP.


#0  0x04711add in mmap_string_truncate () from /usr/local/lib/libetpan.so.11.0
(gdb) bt
#0  0x04711add in mmap_string_truncate () from /usr/local/lib/libetpan.so.11.0
#1  0x04711aaf in mmap_string_assign () from /usr/local/lib/libetpan.so.11.0
#2  0x04711e2c in mailstream_read_line () from /usr/local/lib/libetpan.so.11.0
#3  0x047271ad in read_line () from /usr/local/lib/libetpan.so.11.0
#4  0x04724ff5 in mailimap_connect () from /usr/local/lib/libetpan.so.11.0
#5  0x04727a17 in mailimap_ssl_connect_with_callback () from 
/usr/local/lib/libetpan.so.11.0
#6  0x04727a7f in mailimap_ssl_connect () from /usr/local/lib/libetpan.so.11.0
#7  0x1c117f1c in imap_threaded_connect ()
#8  0x1c1336a6 in etpan_thread_op_free ()
#9  0x03a12fcb in _thread_start () at 
/usr/src/lib/libpthread/uthread/uthread_create.c:244
#10 0x0000001f in ?? ()
#11 0x00000000 in ?? ()


Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/libetpan/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile    23 Mar 2007 17:32:58 -0000      1.1.1.1
+++ Makefile    17 Apr 2007 04:19:19 -0000
@@ -3,6 +3,7 @@
 COMMENT=       "mail purpose library"
 
 DISTNAME=      libetpan-0.49
+PKGNAME=       ${DISTNAME}p1
 CATEGORIES=    mail devel
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=libetpan/}
 SHARED_LIBS=   etpan   11.0
Index: patches/patch-src_low-level_imap_mailimap_c
===================================================================
RCS file: patches/patch-src_low-level_imap_mailimap_c
diff -N patches/patch-src_low-level_imap_mailimap_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_low-level_imap_mailimap_c 17 Apr 2007 04:26:21 -0000
@@ -0,0 +1,32 @@
+$OpenBSD$
+--- src/low-level/imap/mailimap.c.orig Tue Apr 17 00:23:20 2007
++++ src/low-level/imap/mailimap.c      Tue Apr 17 00:25:52 2007
+@@ -2458,18 +2458,22 @@ static int parse_greeting(mailimap * session,
+   greeting_store(session, greeting);
+ 
+   if (greeting->gr_type == MAILIMAP_GREETING_RESP_COND_BYE) {
+-    if (mmap_string_assign(session->imap_response_buffer,
+-            greeting->gr_data.gr_bye->rsp_text->rsp_text) == NULL)
+-      return MAILIMAP_ERROR_MEMORY;
++    if (greeting->gr_data.gr_bye->rsp_text->rsp_text != NULL) {
++      if (mmap_string_assign(session->imap_response_buffer,
++              greeting->gr_data.gr_bye->rsp_text->rsp_text) == NULL)
++        return MAILIMAP_ERROR_MEMORY;
++    }
+ 
+     session->imap_response = session->imap_response_buffer->str;
+     
+     return MAILIMAP_ERROR_DONT_ACCEPT_CONNECTION;
+   }
+ 
+-  if (mmap_string_assign(session->imap_response_buffer,
+-          greeting->gr_data.gr_auth->rsp_text->rsp_text) == NULL)
+-    return MAILIMAP_ERROR_MEMORY;
++  if (greeting->gr_data.gr_auth->rsp_text->rsp_text != NULL) {
++    if (mmap_string_assign(session->imap_response_buffer,
++            greeting->gr_data.gr_auth->rsp_text->rsp_text) == NULL)
++      return MAILIMAP_ERROR_MEMORY;
++  }
+ 
+   session->imap_response = session->imap_response_buffer->str;
+ 

Reply via email to