Skip to content

Commit

Permalink
grn_table_cursor_open: add error check of grn_table_size()
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 12, 2018
1 parent 6a8b2b1 commit fbf7218
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -2587,6 +2587,9 @@ grn_table_cursor_open(grn_ctx *ctx, grn_obj *table,
if (!table) { return tc; }
GRN_API_ENTER;
table_size = grn_table_size(ctx, table);
if (ctx->rc != GRN_SUCCESS) {
GRN_API_RETURN(NULL);
}
if (flags & GRN_CURSOR_PREFIX) {
if (offset < 0) {
ERR(GRN_TOO_SMALL_OFFSET,
Expand Down

0 comments on commit fbf7218

Please sign in to comment.