dovecot-2.2: fts-tika: Fixed crash if Tika returned 200 reply wi...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 30 13:42:58 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/49dfc6da1786
changeset: 17544:49dfc6da1786
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 30 16:41:32 2014 +0300
description:
fts-tika: Fixed crash if Tika returned 200 reply without payload.

diffstat:

 src/plugins/fts/fts-parser-tika.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r c8c9e3a85625 -r 49dfc6da1786 src/plugins/fts/fts-parser-tika.c
--- a/src/plugins/fts/fts-parser-tika.c	Mon Jun 30 14:35:32 2014 +0300
+++ b/src/plugins/fts/fts-parser-tika.c	Mon Jun 30 16:41:32 2014 +0300
@@ -84,8 +84,12 @@
 	switch (response->status) {
 	case 200:
 		/* read response */
-		i_stream_ref(response->payload);
-		parser->payload = response->payload;
+		if (response->payload == NULL)
+			parser->payload = i_stream_create_from_data("", 0);
+		else {
+			i_stream_ref(response->payload);
+			parser->payload = response->payload;
+		}
 		break;
 	case 204: /* empty response */
 	case 422: /* Unprocessable Entity */


More information about the dovecot-cvs mailing list