You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throwmime_error("Parsing failure, header name or value empty: " + header_line);
else
return;
smatch m;
if (!regex_match(header_name, m, HEADER_NAME_REGEX))
throwmime_error("Format failure of the header name `" + header_name + "`.");
in case when the method accepts an empty header_value, header_name wouldn't get checked with regex_match because the code would have returned before this check. But it seems reasonable to check the header_name regardless of whether the mode is strict or not.
I've checked this using the following code and the behaviour was different in two cases: empty value and non-empty value. In the second case an exception is thrown:
Hello.
In the
mime.cpp
there could be a logic error introduced along with adding support for non-strict mode. As you can see in the source file:mailio/src/mime.cpp
Lines 703 to 711 in 3fccce6
in case when the method accepts an empty
header_value
,header_name
wouldn't get checked withregex_match
because the code would have returned before this check. But it seems reasonable to check theheader_name
regardless of whether the mode is strict or not.I've checked this using the following code and the behaviour was different in two cases: empty value and non-empty value. In the second case an exception is thrown:
(
msg_wrapper
is a thin wrapper class asmime::parse_header_name_value()
method is protected).The text was updated successfully, but these errors were encountered: