ソースを参照

sync: Assert sync_callbacks.name length

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 6 年 前
コミット
74eed54a7f
1 ファイル変更3 行追加0 行削除
  1. 3 0
      exec/sync.c

+ 3 - 0
exec/sync.c

@@ -466,6 +466,9 @@ static void sync_servicelist_build_enter (
 		}
 		my_service_list[my_service_list_entries].state = PROCESS;
 		my_service_list[my_service_list_entries].service_id = i;
+
+		assert(strlen(sync_callbacks.name) < sizeof(my_service_list[my_service_list_entries].name));
+
 		strcpy (my_service_list[my_service_list_entries].name,
 			sync_callbacks.name);
 		my_service_list[my_service_list_entries].sync_init = sync_callbacks.sync_init;