Skip to content
Permalink
Browse files

fixed #513 crash or hung of daemon on empty SNIPPET expression; added…

… regressions to test 168
  • Loading branch information
tomatolog committed Sep 20, 2018
1 parent b36d792 commit ad3710d53b5cd6a28b8c60352d0f9e285b03d9fa
Showing with 86 additions and 2 deletions.
  1. +1 −1 src/searchd.cpp
  2. +13 −1 test/test_168/model.bin
  3. +72 −0 test/test_168/test.xml
@@ -6287,7 +6287,7 @@ struct Expr_Snippet_c : public ISphStringExpr
int iResultLength = m_tHighlight.m_dRes.GetLength();
*ppStr = m_tHighlight.m_dRes.LeakData();
// skip trailing zero
return iResultLength-1;
return ( iResultLength ? iResultLength-1 : 0 );
} else
return PackSnippets ( m_tHighlight.m_dRes, m_tHighlight.m_dSeparators, m_tHighlight.m_sChunkSeparator.Length(), ppStr );
}

0 comments on commit ad3710d

Please sign in to comment.
You can’t perform that action at this time.