[dovecot-cvs] dovecot/src/lib-mail message-content-parser.c, 1.11, 1.12

cras at dovecot.org cras at dovecot.org
Mon Jun 13 11:46:00 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv21001/lib-mail

Modified Files:
	message-content-parser.c 
Log Message:
Fixed parsing multiple parameters



Index: message-content-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-content-parser.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- message-content-parser.c	5 Jun 2005 20:07:04 -0000	1.11
+++ message-content-parser.c	13 Jun 2005 08:45:57 -0000	1.12
@@ -33,17 +33,20 @@
 	if (callback != NULL)
 		callback(str_data(str), str_len(str), context);
 
-	if (parser.data == parser.end || *parser.data != ';' ||
-	    param_cb == NULL) {
-		/* no parameters / error / no param callback */
+	if (param_cb == NULL) {
+		/* we don't care about parameters */
 		t_pop();
 		return;
 	}
-	parser.data++;
-        (void)rfc822_skip_lwsp(&parser);
 
-	str_truncate(str, 0);
-	while (rfc822_parse_mime_token(&parser, str) > 0) {
+	while (parser.data != parser.end && *parser.data == ';') {
+		parser.data++;
+		(void)rfc822_skip_lwsp(&parser);
+
+		str_truncate(str, 0);
+		if (rfc822_parse_mime_token(&parser, str) <= 0)
+			break;
+
 		/* <token> "=" <token> | <quoted-string> */
 		if (str_len(str) == 0 || *parser.data != '=' ||
 		    rfc822_skip_lwsp(&parser) <= 0)



More information about the dovecot-cvs mailing list