瀏覽代碼

simple fuzzing of decode functions

Julius Pfrommer 11 年之前
父節點
當前提交
86bcedd29b
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      tests/check_memory.c

+ 5 - 0
tests/check_memory.c

@@ -5,6 +5,7 @@
  *      Author: mrt
  */
 
+#define _XOPEN_SOURCE 500
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -160,6 +161,10 @@ int main() {
 	tcase_add_loop_test(tc, decodeShallFailWithTruncatedBufferButSurvive,UA_BOOLEAN,UA_INVALIDTYPE-1);
 	suite_add_tcase(s,tc);
 
+	tc = tcase_create("Fuzzing with Random Buffers");
+	tcase_add_loop_test(tc, decodeScalarBasicTypeShallSurviveRandomBuffer,UA_BOOLEAN,UA_INVALIDTYPE-1);
+	suite_add_tcase(s,tc);
+
 	sr = srunner_create(s);
 	//for debugging puposes only, will break make check
 	//srunner_set_fork_status(sr,CK_NOFORK);