fix security svace: strcpy 81/126281/3 accepted/tizen/3.0/common/20170511.174314 accepted/tizen/3.0/ivi/20170510.222416 accepted/tizen/3.0/mobile/20170510.222406 accepted/tizen/3.0/wearable/20170510.222411 submit/tizen_3.0/20170510.012602 submit/tizen_3.0_common/20170511.082856
authorJeesun Kim <iamjs.kim@samsung.com>
Fri, 21 Apr 2017 01:08:27 +0000 (10:08 +0900)
committerJeesun Kim <iamjs.kim@samsung.com>
Fri, 21 Apr 2017 01:49:43 +0000 (10:49 +0900)
Signed-off-by: Jeesun Kim <iamjs.kim@samsung.com>
Change-Id: I5cdf32284d126b2e8835f5b0dafdd888895e4730

email-core/email-core-mm-callbacks.c
email-core/email-core-utils.c

index eef6494..8d9208b 100755 (executable)
@@ -258,8 +258,8 @@ INTERNAL_FUNC void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
        }
 
        if (EM_SAFE_STRLEN(username) > 0 && EM_SAFE_STRLEN(password) > 0) {
-               strcpy(user, username);
-               strcpy(pwd, password);
+               EM_SAFE_STRNCPY(user, username, NETMAXUSER- EM_SAFE_STRLEN(user) -1);
+               EM_SAFE_STRNCPY(pwd, password, MAILTMPLEN - EM_SAFE_STRLEN(pwd) -1);
        } else
                EM_DEBUG_EXCEPTION("User Information is NULL || EM_SAFE_STRLEN is 0 ");
 
index 02d00b4..01b57a0 100755 (executable)
@@ -3246,7 +3246,7 @@ int emcore_strip_HTML_tag(const char *input_html_file_path, char *input_encoding
 
        emcore_get_content_string(root_element, result_string, input_result_buffer_legnth, &exit_flag);
        char *replaced_string = reg_replace_new(result_string, "[ \t\r\n\v\f]+", " ");
-       EM_SAFE_STRCPY(output_result_buffer, replaced_string);
+       EM_SAFE_STRNCPY(output_result_buffer, replaced_string, input_result_buffer_legnth - EM_SAFE_STRLEN(output_result_buffer) -1);
        EM_SAFE_FREE(replaced_string);
        em_trim_left(output_result_buffer);