Kouhei Sutou
null+****@clear*****
Mon Aug 29 18:07:55 JST 2016
Kouhei Sutou 2016-08-29 18:07:55 +0900 (Mon, 29 Aug 2016) New Revision: aa7c615e272ce13db1056f04ea0ee82c51919e0f https://github.com/groonga/groonga/commit/aa7c615e272ce13db1056f04ea0ee82c51919e0f Message: Add NULL check on getting all indexes Modified files: lib/db.c Modified: lib/db.c (+19 -0) =================================================================== --- lib/db.c 2016-08-29 17:57:30 +0900 (b06131a) +++ lib/db.c 2016-08-29 18:07:55 +0900 (f7ed1e2) @@ -12947,6 +12947,25 @@ grn_column_get_all_index_data_column(grn_ctx *ctx, grn_obj_default_set_value_hook_data *data = (void *)GRN_NEXT_ADDR(hooks); grn_obj *target = grn_ctx_at(ctx, data->target); int section = 0; + if (!target) { + char name[GRN_TABLE_MAX_KEY_SIZE]; + int length; + char hook_name[GRN_TABLE_MAX_KEY_SIZE]; + int hook_name_length; + + length = grn_obj_name(ctx, obj, name, GRN_TABLE_MAX_KEY_SIZE); + hook_name_length = grn_table_get_key(ctx, + ctx->impl->db, + data->target, + hook_name, + GRN_TABLE_MAX_KEY_SIZE); + ERR(GRN_OBJECT_CORRUPT, + "[column][indexes][all] " + "hook has a dangling reference: <%.*s> -> <%.*s>", + length, name, + hook_name_length, hook_name); + continue; + } if (target->header.type != GRN_COLUMN_INDEX) { continue; } -------------- next part -------------- HTML����������������������������... Download