From 9e2a4c3114273036f8759d8e5bd42cf85608b25b Mon Sep 17 00:00:00 2001 From: Sunghyun Kwon Date: Mon, 6 May 2013 21:09:09 +0900 Subject: [PATCH] Fixed the crash during image data parsing --- email-core/email-core-mailbox-sync.c | 10 ++++++++-- packaging/email-service.spec | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/email-core/email-core-mailbox-sync.c b/email-core/email-core-mailbox-sync.c index 328b5ee..dfcebcc 100755 --- a/email-core/email-core-mailbox-sync.c +++ b/email-core/email-core-mailbox-sync.c @@ -3282,8 +3282,14 @@ static int emcore_parse_image_part_for_partial_body(char *header_start_string, c EM_DEBUG_LOG("Content-type: image"); - while (image_boundary && *image_boundary != LF) + while ((image_boundary > bufsendforparse) && (*image_boundary != LF)) { image_boundary--; + } + + if (image_boundary <= bufsendforparse) { + EM_DEBUG_CRITICAL_EXCEPTION("== bufsendforparse =="); + EM_DEBUG_CRITICAL_EXCEPTION("%s", bufsendforparse); + } image_boundary++; @@ -3294,7 +3300,7 @@ static int emcore_parse_image_part_for_partial_body(char *header_start_string, c return false; } - if (image_boundary != NULL && image_boundary_end != NULL) + if (image_boundary != NULL && image_boundary_end != NULL) memcpy(temp_image_boundary, image_boundary, image_boundary_end-image_boundary); if ((char *)strcasestr((const char *)temp_image_boundary, "Content-type:") == NULL) diff --git a/packaging/email-service.spec b/packaging/email-service.spec index 7e7aa9b..e7cd4c9 100755 --- a/packaging/email-service.spec +++ b/packaging/email-service.spec @@ -1,6 +1,6 @@ Name: email-service Summary: E-mail Framework Middleware package -Version: 0.10.98 +Version: 0.10.99 Release: 1 Group: System/Libraries License: TBD -- 2.7.4