[Groonga-commit] groonga/groonga at 2d09d2b [master] Fix a crash bug by early unlink

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Dec 23 20:43:49 JST 2017


Kouhei Sutou	2017-12-23 20:43:49 +0900 (Sat, 23 Dec 2017)

  New Revision: 2d09d2b7a90f7fcfbe070d9d5535aab1cdcb6496
  https://github.com/groonga/groonga/commit/2d09d2b7a90f7fcfbe070d9d5535aab1cdcb6496

  Message:
    Fix a crash bug by early unlink
    
    It's not caused by instruction in grn_expr_parse() but it's caused when
    libgroonga user such as Mroonga uses the following instructions:
    
      1. grn_expr_append_const("_id")
      2. grn_expr_append_op(GRN_OP_GET_VALUE)

  Modified files:
    lib/expr.c

  Modified: lib/expr.c (+3 -1)
===================================================================
--- lib/expr.c    2017-12-23 00:50:14 +0900 (738948c51)
+++ lib/expr.c    2017-12-23 20:43:49 +0900 (a5c68d22d)
@@ -1248,7 +1248,9 @@ grn_expr_append_obj(grn_ctx *ctx, grn_obj *expr, grn_obj *obj, grn_operator op,
                 dfi0->code->value = col;
                 type = col->header.type;
                 domain = grn_obj_get_range(ctx, col);
-                grn_obj_unlink(ctx, col);
+                if (col->header.type == GRN_ACCESSOR) {
+                  grn_expr_take_obj(ctx, expr, col);
+                }
               }
             } else {
               domain = grn_obj_get_range(ctx, obj);
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171223/e5bb65c9/attachment.htm 



More information about the Groonga-commit mailing list
Back to archive index