[Groonga-commit] groonga/groonga at d910f1e [master] grn_pat: fix a bug that a variable may be used uninitialized

Back to archive index

susumu.yata null+****@clear*****
Tue Oct 13 12:01:06 JST 2015


susumu.yata	2015-10-13 12:01:06 +0900 (Tue, 13 Oct 2015)

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

  Message:
    grn_pat: fix a bug that a variable may be used uninitialized
    
    GitHub: #418

  Modified files:
    lib/pat.c

  Modified: lib/pat.c (+2 -2)
===================================================================
--- lib/pat.c    2015-10-11 19:09:00 +0900 (e24dbe7)
+++ lib/pat.c    2015-10-13 12:01:06 +0900 (6c1d334)
@@ -610,8 +610,9 @@ _grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint
   grn_id r, r0, *p0, *p1 = NULL;
   pat_node *rn, *rn0;
   int c, c0 = -1, c1 = -1, len;
-
   uint32_t cache_id = 0;
+
+  *new = 0;
   if (pat->cache) {
     const uint8_t *p = key;
     uint32_t length = size;
@@ -628,7 +629,6 @@ _grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint
     }
   }
 
-  *new = 0;
   len = (int)size * 16;
   PAT_AT(pat, 0, rn0);
   p0 = &rn0->lr[1];
-------------- next part --------------
HTML����������������������������...
Download 



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