#vulnerable code 
                              @Override
  public IndexIterator ids(final IndexToken ind) {
    if(ind.range()) return idRange((RangeToken) ind);
    
    final FTTokenizer ft = (FTTokenizer) ind;
    final byte[] tok = ft.get();
    if(ft.fz) {
      int k = Prop.lserr;
      if(k == 0) k = Math.max(1, tok.length >> 2);
      final int[][] ids = getNodeFuzzy(0, null, -1, tok, 0, 0, 0, k);
      return new IndexArrayIterator(ids[0], ids[1]);
    }

    if(ft.wc) {
      final int pw = Token.indexOf(tok, '.');
      if(pw != -1) {
        final int[][] ids = getNodeFromTrieWithWildCard(tok, pw);
        return new IndexArrayIterator(ids[0], ids[1]);
      }
    }
    
    if(!cs && ft.cs) {
      // case insensitive index create - check real case with dbdata
      int[][] ids = getNodeFromTrieRecursive(0, Token.lc(tok), false);
      if(ids == null) {
        return null;
      }

      byte[] tokenFromDB;
      byte[] textFromDB;
      int[][] rIds = new int[2][ids[0].length];
      int count = 0;
      int readId;

      int i = 0;
      // check real case of each result node
      while(i < ids[0].length) {
        // get date from disk
        readId = ids[0][i];
        textFromDB = data.text(ids[0][i]);
        tokenFromDB = new byte[tok.length];

        System.arraycopy(textFromDB, ids[1][i], tokenFromDB, 0, tok.length);

        // check unique node ones
        while(i < ids[0].length && readId == ids[0][i]) {
          System.arraycopy(textFromDB, ids[1][i], tokenFromDB, 0, tok.length);

          readId = ids[0][i];

          // check unique node ones
          // compare token from db with token from query
          if(Token.eq(tokenFromDB, tok)) {
            rIds[0][count] = ids[0][i];
            rIds[1][count++] = ids[1][i];

            // jump over same ids
            while(i < ids[0].length && readId == ids[0][i])
              i++;
            break;
          }
          i++;
        }
      }

      if(count == 0) return null;

      final int[][] tmp = new int[2][count];
      System.arraycopy(rIds[0], 0, tmp[0], 0, count);
      System.arraycopy(rIds[1], 0, tmp[1], 0, count);
      return new IndexArrayIterator(tmp[0], tmp[1]);
    }
    
    final int[][] tmp = getNodeFromTrieRecursive(0, tok, ft.cs);
    return new IndexArrayIterator(tmp[0], tmp[1]);
  } 
                            #location 71 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Override
  public IndexIterator ids(final IndexToken ind) {
    if(ind.range()) return idRange((RangeToken) ind);
    
    final FTTokenizer ft = (FTTokenizer) ind;
    final byte[] tok = ft.get();
    if(ft.fz) {
      int k = Prop.lserr;
      if(k == 0) k = Math.max(1, tok.length >> 2);
      final int[][] ids = getNodeFuzzy(0, null, -1, tok, 0, 0, 0, k);
      return new IndexArrayIterator(ids);
    }

    if(ft.wc) {
      final int pw = Token.indexOf(tok, '.');
      if(pw != -1) {
        final int[][] ids = getNodeFromTrieWithWildCard(tok, pw);
        return new IndexArrayIterator(ids);
      }
    }
    
    if(!cs && ft.cs) {
      // case insensitive index create - check real case with dbdata
      int[][] ids = getNodeFromTrieRecursive(0, Token.lc(tok), false);
      if(ids == null) {
        return null;
      }

      byte[] tokenFromDB;
      byte[] textFromDB;
      int[][] rIds = new int[2][ids[0].length];
      int count = 0;
      int readId;

      int i = 0;
      // check real case of each result node
      while(i < ids[0].length) {
        // get date from disk
        readId = ids[0][i];
        textFromDB = data.text(ids[0][i]);
        tokenFromDB = new byte[tok.length];

        System.arraycopy(textFromDB, ids[1][i], tokenFromDB, 0, tok.length);

        // check unique node ones
        while(i < ids[0].length && readId == ids[0][i]) {
          System.arraycopy(textFromDB, ids[1][i], tokenFromDB, 0, tok.length);

          readId = ids[0][i];

          // check unique node ones
          // compare token from db with token from query
          if(Token.eq(tokenFromDB, tok)) {
            rIds[0][count] = ids[0][i];
            rIds[1][count++] = ids[1][i];

            // jump over same ids
            while(i < ids[0].length && readId == ids[0][i])
              i++;
            break;
          }
          i++;
        }
      }
      return new IndexArrayIterator(rIds, count);
    }
    
    final int[][] tmp = getNodeFromTrieRecursive(0, tok, ft.cs);
    return new IndexArrayIterator(tmp);
  }