Add an upstream patch to fix a crash in the tika FTS plugin.

Submitted by:	ler
Obtained from:	3751b61dfb.patch
This commit is contained in:
Adam Weinberger 2017-03-22 15:15:42 +00:00
parent 07c9affdc1
commit 6f4ec53e76
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=436705
2 changed files with 31 additions and 1 deletions

View file

@ -14,7 +14,7 @@
PORTNAME= dovecot
PORTVERSION= 2.2.28
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= mail ipv6
MASTER_SITES= https://www.dovecot.org/releases/${PORTVERSION:R}/
PKGNAMESUFFIX= 2

View file

@ -0,0 +1,30 @@
From 3751b61dfbc6c141731a740d982fc59918db2482 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martti=20Rannanj=C3=A4rvi?= <martti.rannanjarvi@dovecot.fi>
Date: Wed, 1 Mar 2017 12:29:17 +0200
Subject: [PATCH] fts: Don't add NULL content disposition or type to HTTP
header
---
src/plugins/fts/fts-parser-tika.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/plugins/fts/fts-parser-tika.c b/src/plugins/fts/fts-parser-tika.c
index 8457f28..385f1d0 100644
--- src/plugins/fts/fts-parser-tika.c
+++ src/plugins/fts/fts-parser-tika.c
@@ -158,9 +158,12 @@ fts_parser_tika_try_init(struct mail_user *user, const char *content_type,
fts_tika_parser_response, parser);
http_client_request_set_port(http_req, http_url->port);
http_client_request_set_ssl(http_req, http_url->have_ssl);
- http_client_request_add_header(http_req, "Content-Type", content_type);
- http_client_request_add_header(http_req, "Content-Disposition",
- content_disposition);
+ if (content_type != NULL)
+ http_client_request_add_header(http_req, "Content-Type",
+ content_type);
+ if (content_disposition != NULL)
+ http_client_request_add_header(http_req, "Content-Disposition",
+ content_disposition);
http_client_request_add_header(http_req, "Accept", "text/plain");
parser->http_req = http_req;