null+****@clear*****
null+****@clear*****
2010年 9月 30日 (木) 14:39:16 JST
Kouhei Sutou 2010-09-30 05:39:16 +0000 (Thu, 30 Sep 2010) New Revision: a9439c2c6d18b51a8c34fa78679782a055de8307 Log: check invalid ID or not. Modified files: lib/str.c Modified: lib/str.c (+8 -4) =================================================================== --- lib/str.c 2010-09-28 01:14:06 +0000 (7c876c9) +++ lib/str.c 2010-09-30 05:39:16 +0000 (2791841) @@ -2661,10 +2661,14 @@ grn_text_otoj(grn_ctx *ctx, grn_obj *bulk, grn_obj *obj, grn_obj_format *format) grn_obj *table = grn_ctx_at(ctx, obj->header.domain); grn_id id = *((grn_id *)GRN_BULK_HEAD(obj)); if (table && table->header.type != GRN_TABLE_NO_KEY) { - grn_obj *accessor = grn_obj_column(ctx, table, "_key", 4); - if (accessor) { - grn_obj_get_value(ctx, accessor, id, &buf); - grn_obj_unlink(ctx, accessor); + grn_obj *record = grn_ctx_at(ctx, id); + if (record) { + grn_obj *accessor = grn_obj_column(ctx, table, "_key", 4); + if (accessor) { + grn_obj_get_value(ctx, accessor, id, &buf); + grn_obj_unlink(ctx, accessor); + } + grn_obj_unlink(ctx, record); } grn_text_otoj(ctx, bulk, &buf, format); } else {