Fix an imap crash with a patch from libetpan CVS.

From brad, ok ckuethe.
This commit is contained in:
deanna 2007-05-04 23:33:05 +00:00
parent dfa1c08396
commit 7c8b446beb
2 changed files with 34 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2007/03/23 17:32:58 deanna Exp $
# $OpenBSD: Makefile,v 1.2 2007/05/04 23:33:05 deanna Exp $
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

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-src_low-level_imap_mailimap_c,v 1.1 2007/05/04 23:33:05 deanna Exp $
--- 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;