Commit 9a85b9aa 9a85b9aa8fe0e9de86801fa75eb276cca78421e7 by Sergey Poznyakoff

parse822_word(): Additional check for qstr != NULL:

parse822_quoted_string() sometimes returns EOK and does not fill
qstr (e.g. when parsing empty string: "")
1 parent 47546d96
......@@ -466,7 +466,7 @@ int parse822_quoted_string(const char** p, const char* e, char** qstr)
} else if(c == '\\') {
rc = parse822_quoted_pair(p, e, qstr);
} else if(c == '\r') {
/* invalid character... */
/* invalid character... */
*p += 1;
} else if(parse822_is_char(c)) {
rc = str_append_char(qstr, c);
......@@ -498,7 +498,7 @@ int parse822_word(const char** p, const char* e, char** word)
{
char* qstr = 0;
if((rc = parse822_quoted_string(p, e, &qstr)) == EOK) {
if((rc = parse822_quoted_string(p, e, &qstr)) == EOK && qstr) {
rc = str_append(word, qstr);
str_free(&qstr);
......