[Groonga-commit] groonga/groonga at 14e634a [master] grn_pat: fix a bug of grn_pat_delete()

Back to archive index

susumu.yata null+****@clear*****
Mon Oct 19 13:42:46 JST 2015


susumu.yata	2015-10-19 13:42:46 +0900 (Mon, 19 Oct 2015)

  New Revision: 14e634ab4890a4756e499543768ab732ea9bc1d9
  https://github.com/groonga/groonga/commit/14e634ab4890a4756e499543768ab732ea9bc1d9

  Message:
    grn_pat: fix a bug of grn_pat_delete()
    
    Note that this is a quick-fix approach.
    
    GitHub: #420

  Modified files:
    lib/pat.c

  Modified: lib/pat.c (+5 -0)
===================================================================
--- lib/pat.c    2015-10-19 10:56:44 +0900 (a0f20b9)
+++ lib/pat.c    2015-10-19 13:42:46 +0900 (1243061)
@@ -1099,6 +1099,11 @@ _grn_pat_del(grn_ctx *ctx, grn_pat *pat, const char *key, uint32_t key_size, int
   uint32_t len = key_size * 16;
   grn_id r, otherside, *proot, *p, *p0 = NULL;
 
+  /* FIXME: This is a quick-fix approach. */
+  if (_grn_pat_get(ctx, pat, key, key_size, NULL) == GRN_ID_NIL) {
+    return GRN_INVALID_ARGUMENT;
+  }
+
   /* delinfo_new() must be called before searching for rn. */
   di = delinfo_new(ctx, pat);
   di->shared = shared;
-------------- next part --------------
HTML����������������������������...
Download 



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