(parse822_quoted_string): Free qstr before
returning error status. Otherwise, addresses like "A wrong quote\" <addr@dom.ain> hit the assert in parse822_word() and coredump. (parse822_word_dot): Removed misleading comment.
Showing
1 changed file
with
4 additions
and
17 deletions
... | @@ -551,11 +551,12 @@ parse822_quoted_string (const char **p, const char *e, char **qstr) | ... | @@ -551,11 +551,12 @@ parse822_quoted_string (const char **p, const char *e, char **qstr) |
551 | if (rc) | 551 | if (rc) |
552 | { | 552 | { |
553 | *p = save; | 553 | *p = save; |
554 | str_free (qstr); | ||
554 | return rc; | 555 | return rc; |
555 | } | 556 | } |
556 | } | 557 | } |
557 | *p = save; | 558 | *p = save; |
558 | 559 | str_free (qstr); | |
559 | return EPARSE; /* end-of-qstr not found */ | 560 | return EPARSE; /* end-of-qstr not found */ |
560 | } | 561 | } |
561 | 562 | ||
... | @@ -617,22 +618,8 @@ parse822_word (const char **p, const char *e, char **word) | ... | @@ -617,22 +618,8 @@ parse822_word (const char **p, const char *e, char **word) |
617 | return EPARSE; | 618 | return EPARSE; |
618 | } | 619 | } |
619 | 620 | ||
620 | /* rfc822 says: | 621 | /* Some mailers do not quote personal part even if it contains dot. |
621 | The local-part of an addr-spec in a mailbox specification | 622 | Try to be smart about it. |
622 | (i.e., the host's name for the mailbox) is understood to be | ||
623 | whatever the receiving mail protocol server allows. For exam- | ||
624 | ple, some systems do not understand mailbox references of the | ||
625 | form "P. D. Q. Bach", but others do. | ||
626 | |||
627 | This specification treats periods (".") as lexical separators. | ||
628 | Hence, their presence in local-parts which are not quoted- | ||
629 | strings, is detected. However, such occurrences carry NO | ||
630 | semantics. That is, if a local-part has periods within it, an | ||
631 | address parser will divide the local-part into several tokens, | ||
632 | but the sequence of tokens will be treated as one uninter- | ||
633 | preted unit. The sequence will be re-assembled, when the | ||
634 | address is passed outside of the system such as to a mail pro- | ||
635 | tocol service. | ||
636 | */ | 623 | */ |
637 | 624 | ||
638 | int | 625 | int | ... | ... |
-
Please register or sign in to post a comment