And then checking imap_parse_string_generic (which is what imap_parse_string() mapped to via #define )
Reveals that inptr MUST be checked for being NULL after the call.
From imap_parse_string_generic in-file doc:
* Return value: the parsed string, or %NULL if a NIL or no string
* was parsed. (In the former case, *@str_p will be %NULL; in the
* latter, it will point to the character after the NIL.)
Conclusion:
1. inptr could need duplicating before call to imap_body_decode(), because it's value is not constant
2. inptr MUST be checked for NULL after the call
IMHO - this is a clear bug, even more, specially crafted e-mail and/or IMAP server could exploit this bug for DoS at end-user side.
So, could be even a security issue.
Well, after quict look at code in camel/providers /imap/camel- imap-utils. c: git.gnome. org./cgit/ evolution- data-server/ tree/camel/ providers/ imap/camel- imap-utils. c?id=6be48b0f55 981e67fab9f8243 d2d504387dc5691 )
( http://
if (g_ascii_ strncasecmp (inptr, "nil", 3) != 0) {
923: subtype = imap_parse_string (&inptr, &len);
} else {
subtype = NULL;
inptr += 3;
}
ctype = camel_content_ type_new ("multipart", subtype ? subtype : "mixed");
g_free (subtype);
932: if (*inptr++ != ')') { content_ type_unref (ctype);
camel_
return NULL;
}
And then checking imap_parse_ string_ generic (which is what imap_parse_string() mapped to via #define )
Reveals that inptr MUST be checked for being NULL after the call. string_ generic in-file doc:
From imap_parse_
* Return value: the parsed string, or %NULL if a NIL or no string
* was parsed. (In the former case, *@str_p will be %NULL; in the
* latter, it will point to the character after the NIL.)
Conclusion:
1. inptr could need duplicating before call to imap_body_decode(), because it's value is not constant
2. inptr MUST be checked for NULL after the call
IMHO - this is a clear bug, even more, specially crafted e-mail and/or IMAP server could exploit this bug for DoS at end-user side.
So, could be even a security issue.