if (body_file != NULL) {
fseek(body_file, 0, SEEK_END);
email_size = ftell(body_file);
+ if (email_size <= 0) {
+ ERR("email_size is not a positive number");
+ g_string_free(msg, TRUE);
+ fclose(body_file);
+ return NULL;
+ }
rewind(body_file);
buf = (char *)g_malloc0(sizeof(char) * email_size);
DBG("MESSAGE: [%s]", buf);
if (read_size != email_size) {
ERR("Unequal Read size");
- email_free_mail_data(&mail_data, 1);
g_string_free(msg, TRUE);
g_free(buf);
return NULL;