[groonga-dev,00167] [PATCH] test-hash-table.c (retrieve_all_values) で stack overflow

Back to archive index

Yuto Hayamizu y.hay****@gmail*****
2009年 8月 24日 (月) 16:58:15 JST


こんにちは. はやみずです.
32bit 環境において, test-hash-table.c のテスト test_sort_by_uint_key を実行したときに,
retrieve_all_values で stack overflow でプログラムが落ちるバグを見つけました.

パッチは github で pull request しておきましたので, 取り込んでいただけると幸いです.



diff --git a/test/unit/core/test-hash-sort.c b/test/unit/core/test-hash-sort.c
index dc761a4..8dc7e64 100644
--- a/test/unit/core/test-hash-sort.c
+++ b/test/unit/core/test-hash-sort.c
@@ -190,7 +190,6 @@ retrieve_all_values (grn_array *array, grn_id n_entries)
     grn_array_cursor_get_value(context, cursor, &array_value);
     hash_id = array_value;
     size = grn_hash_get_value(context, hash, *hash_id, value);
-    value[size]= '\0';
     values = g_list_append(values, g_strdup(value));
     id = grn_array_cursor_next(context, cursor);
   }




groonga-dev メーリングリストの案内
Back to archive index