Nov11 / ik-analyzer

Automatically exported from code.google.com/p/ik-analyzer
0 stars 0 forks source link

组合词元时有潜在代码漏洞 #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. 
使用字符串“水瓶座=70万”作为输入,同时IKSegmenter设置为启
动智能分词模式
2. 报空指针异常

What is the expected output? What do you see instead?
期望输出:水瓶座 70万
实际输出:空指针异常

What version of the product are you using? On what operating system?
版本使用IK Analyzer 2012,系统winXP

Please provide any additional information below.
在AnalyzeContext.java的第379行位置,

            //可能存在第二轮合并
            if(Lexeme.TYPE_CNUM == result.getLexemeType()){
                Lexeme nextLexeme = this.results.peekFirst();

这里有可能队列已经为空,建议
/**建议加入语句进行空判断**/
//              if(this.results.isEmpty())
//                  return;

Original issue reported on code.google.com by jysoftw...@gmail.com on 24 Apr 2012 at 6:27

GoogleCodeExporter commented 8 years ago
感谢。
请下载2012的最近版本,该bug已经修订

Original comment by linliang...@gmail.com on 2 May 2012 at 2:15