Browse code

Buffer over indexing fix.

Puskás Zoltán authored on 31/01/2012 21:12:51
Showing 1 changed files

... ...
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
114 114
     int guess_flag = 0;
115 115
     int gen_pattern_len = 0;
116 116
     FILE *pattern_file = NULL;
117
-    char *guess_node_list;
117
+    char *guess_node_list = NULL;
118 118
     int i, j;
119 119
 
120 120
     if (argc < 2) {
... ...
@@ -498,10 +498,10 @@ void print_random_patterns(const struct tree_node * const root_node, int len)
498 498
  */
499 499
 void fill_guess_matrix(char* nodelist, int block_matrix[][10])
500 500
 {
501
-    int nodes[MAX_POINTS] = {0};
501
+    int nodes[MAX_POINTS+1] = {0};
502 502
     int i,j;
503 503
      
504
-    /* add nodes to be used of guessing */
504
+    /* add nodes to be used for guessing */
505 505
     for(i=0, j=0; nodelist[i]!='\0'; i++)
506 506
     {
507 507
         j = nodelist[i] - '0';