Skip to content
Permalink
Browse files

fixed crash of daemon on access of large JSON string; fixed #685; add…

…ed regression to test 253
  • Loading branch information...
eugene
eugene committed Feb 14, 2019
1 parent 303b1ee commit e2d592773f4fd702ace90070a793a842a0fec6ab
Showing with 64 additions and 3 deletions.
  1. +7 −1 src/sphinxexpr.cpp
  2. +2 −2 test/test_253/model.bin
  3. +55 −0 test/test_253/test.xml
@@ -1251,7 +1251,13 @@ struct Expr_JsonFieldConv_c : public ISphExpr
{
const BYTE * pVal = nullptr;
ESphJsonType eJson = GetKey ( &pVal, tMatch );
return ( eJson==JSON_STRING ) ? sphUnpackStr ( pVal, ppStr ) : 0;
if ( eJson!=JSON_STRING)
return 0;

// using sphUnpackStr() is wrong, because BSON uses different store format of string length
int iLen = sphJsonUnpackInt ( &pVal );
*ppStr = pVal;
return iLen;
}

float Eval ( const CSphMatch & tMatch ) const override { return DoEval<float> ( tMatch ); }
Oops, something went wrong.

0 comments on commit e2d5927

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