[Groonga-commit] groonga/groonga at 6ebf52a [master] Add length check

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Thu Nov 12 22:23:26 JST 2015


Kouhei Sutou	2015-11-12 22:23:26 +0900 (Thu, 12 Nov 2015)

  New Revision: 6ebf52a2fc431c588fbcbaf7f54ecdb7c4b14938
  https://github.com/groonga/groonga/commit/6ebf52a2fc431c588fbcbaf7f54ecdb7c4b14938

  Message:
    Add length check

  Modified files:
    lib/operator.c

  Modified: lib/operator.c (+4 -0)
===================================================================
--- lib/operator.c    2015-11-12 22:13:07 +0900 (24ef1c7)
+++ lib/operator.c    2015-11-12 22:23:26 +0900 (90eeb88)
@@ -858,6 +858,10 @@ exec_text_operator(grn_ctx *ctx,
 {
   grn_bool matched = GRN_FALSE;
 
+  if (target_len == 0 || query_len == 0) {
+    return GRN_FALSE;
+  }
+
   switch (op) {
   case GRN_OP_MATCH :
     matched = string_have_sub_text(ctx, target, target_len, query, query_len);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index