[Groonga-commit] groonga/groonga [fix-crash-by-invalid-argument-filter] Break select loop when an error is occurred

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Sep 10 17:15:30 JST 2012


Kouhei Sutou	2012-09-10 17:15:30 +0900 (Mon, 10 Sep 2012)

  New Revision: b6317296aa10233d464476816e2bfc5e024a25ba
  https://github.com/groonga/groonga/commit/b6317296aa10233d464476816e2bfc5e024a25ba

  Log:
    Break select loop when an error is occurred

  Modified files:
    lib/expr.c

  Modified: lib/expr.c (+5 -1)
===================================================================
--- lib/expr.c    2012-09-10 17:13:12 +0900 (a59f32a)
+++ lib/expr.c    2012-09-10 17:15:30 +0900 (27d603b)
@@ -4309,14 +4309,18 @@ grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
           }
           processed = grn_table_select_select_by_index(ctx, table, si, res);
           if (!processed) {
+            if (ctx->rc) { break; }
             e->codes = codes + si->start;
             e->codes_curr = si->end - si->start + 1;
             grn_table_select_(ctx, table, expr, v, res, si->logical_op);
           }
         }
-        SI_FREE(si);
         LAP(":", "filter(%d)", grn_table_size(ctx, res));
       }
+      for (i = 0; i < n; i++) {
+        scan_info *si = sis[i];
+        SI_FREE(si);
+      }
       GRN_OBJ_FIN(ctx, &res_stack);
       GRN_FREE(sis);
       e->codes = codes;
-------------- next part --------------
HTML����������������������������...
Download 



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