From f91943147ed48adbdaa235bacdc91c2d0050021b Mon Sep 17 00:00:00 2001 From: pfelt Date: Thu, 25 Oct 2007 04:42:23 +0000 Subject: [PATCH] -- i'm not sure how multipart messages ever worked. the response from nmap with the mime bodystructure is quite long, but we'd only ever copy 4 bytes worth of it and try and use that to parse the data. --- src/agents/imap/fetch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/agents/imap/fetch.c b/src/agents/imap/fetch.c index 4c16bf1..c73b509 100644 --- a/src/agents/imap/fetch.c +++ b/src/agents/imap/fetch.c @@ -3027,8 +3027,11 @@ GetMimeInfo(ImapSession *session, FetchStruct *FetchRequest) while(ccode != 1000) { if ((ccode > 2001) && (ccode < 2005)) { char *entry; - entry = MemMalloc(sizeof(char) * (strlen(session->store.response) + 1)); - memcpy(entry, session->store.response, sizeof(entry)); + size_t len = sizeof(char) * (strlen(session->store.response) + 1); + + entry = MemMalloc(len); + memcpy(entry, session->store.response, len); + BongoArrayAppendValue(FetchRequest->messageDetail.mimeInfo, entry); ccode = NMAPReadResponse(session->store.conn, session->store.response, sizeof(session->store.response), FALSE); continue;