Navigation Menu

Skip to content

Commit

Permalink
TokenMecab: add missing error check
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 11, 2018
1 parent 29e9074 commit 1334897
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/tokenizers/mecab.c
Expand Up @@ -797,7 +797,10 @@ mecab_next_default_format(grn_ctx *ctx,
grn_token_set_data(ctx, token, surface, surface_length);
{
grn_tokenizer_status status;
if (tokenizer->next == tokenizer->end) {
if (surface_length == 0) {
/* Error */
status = GRN_TOKEN_LAST;
} else if (tokenizer->next == tokenizer->end) {
if (tokenizer->loose.need) {
tokenizer->loose.ing = GRN_TRUE;
status = GRN_TOKEN_CONTINUE;
Expand Down

0 comments on commit 1334897

Please sign in to comment.