doris-thirdparty icon indicating copy to clipboard operation
doris-thirdparty copied to clipboard

[fix](inverted index) reject null bytes in term middle to avoid stack overflow

Open zzzxl1993 opened this issue 3 months ago • 0 comments

✅ 允许(放行) "\0\0\0\0" → upto=0, all_trailing_nulls=true → ✅ 放行(空字符串+填充) "hello\0\0\0" → upto=5, all_trailing_nulls=true → ✅ 放行(CHAR填充) "abc\0\0" → upto=3, all_trailing_nulls=true → ✅ 放行(CHAR填充)

❌ 拒绝(抛异常) "\0hello" → upto=0, all_trailing_nulls=false → ❌ 拒绝(中间有内容) "hel\0lo" → upto=3, all_trailing_nulls=false → ❌ 拒绝(中间有内容) "abc\0\0xyz" → upto=3, all_trailing_nulls=false → ❌ 拒绝(中间有内容)

clucene以"\0"作为字符串结尾,当传入字符串有"\0"会导致程序异常(quick sort 死循环栈溢出),目前暂不修改让clucene支持“\0”字符串,增加异常判断在出现异常数据时抛出异常

zzzxl1993 avatar Nov 05 '25 06:11 zzzxl1993