aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_netjail_stop_testsystem.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-12-08 20:51:35 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-12-08 20:51:35 +0900
commit7768a7a75ee959b53cf7a7acdfa0a8c7b17de99e (patch)
treeaaabeaa4b8e8a0afe82d8d7538d271525105da48 /src/testing/testing_api_cmd_netjail_stop_testsystem.c
parentdccf4142eaac44711692c295d81e0103c8042cd2 (diff)
downloadgnunet-7768a7a75ee959b53cf7a7acdfa0a8c7b17de99e.tar.gz
gnunet-7768a7a75ee959b53cf7a7acdfa0a8c7b17de99e.zip
TESTING: Sanitize API. Add new GNUNET_TESTING_command_new API
This commit changes the label member of GNUNET_TRANSPORT_Command to a static, fixed length buffer allocated with the struct itself. The check for the end of a command array should be done by checking the run command instead of the label.
Diffstat (limited to 'src/testing/testing_api_cmd_netjail_stop_testsystem.c')
-rw-r--r--src/testing/testing_api_cmd_netjail_stop_testsystem.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/testing/testing_api_cmd_netjail_stop_testsystem.c b/src/testing/testing_api_cmd_netjail_stop_testsystem.c
index 69455c909..38b14ac5c 100644
--- a/src/testing/testing_api_cmd_netjail_stop_testsystem.c
+++ b/src/testing/testing_api_cmd_netjail_stop_testsystem.c
@@ -147,12 +147,8 @@ GNUNET_TESTING_cmd_stop_testing_system (
147 shs->known = topology->nodes_x; 147 shs->known = topology->nodes_x;
148 shs->topology = topology; 148 shs->topology = topology;
149 149
150 struct GNUNET_TESTING_Command cmd = { 150 return GNUNET_TESTING_command_new (shs, label,
151 .cls = shs, 151 &stop_testing_system_run,
152 .label = GNUNET_strdup (label), 152 &stop_testing_system_cleanup,
153 .run = &stop_testing_system_run, 153 NULL, NULL);
154 .cleanup = &stop_testing_system_cleanup,
155 };
156
157 return cmd;
158} 154}