File: fix-2540.patch

package info (click to toggle)
sphinxsearch 2.2.11-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,724 kB
  • sloc: cpp: 102,259; xml: 85,608; sh: 9,259; php: 3,790; ansic: 3,158; yacc: 1,969; java: 1,336; ruby: 1,289; python: 1,062; pascal: 912; perl: 381; lex: 275; makefile: 150; sql: 77; cs: 35
file content (23 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Stanislav Klinov <tomat@sphinxsearch.com>
Date: Tue, 6 Sep 2016 23:15:34 +0300
Subject: [PATCH] fixed #2504 daemon crash on snippet generation for empty
 documents with html_strip enabled

---
 src/sphinx.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sphinx.cpp b/src/sphinx.cpp
index d6a7b9d..698b8af 100644
--- a/src/sphinx.cpp
+++ b/src/sphinx.cpp
@@ -25272,6 +25272,9 @@ static inline int HtmlEntityLookup ( const BYTE * str, int len )
 
 void CSphHTMLStripper::Strip ( BYTE * sData ) const
 {
+	if ( !sData )
+		return;
+
 	const BYTE * s = sData;
 	BYTE * d = sData;
 	for ( ;; )