diff options
author | Joey Adams <joeyadams3.14159@gmail.com> | 2011-01-06 15:12:18 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-01-07 13:17:24 +1030 |
commit | 5f4051eaef69310d43dfdc66bb60a5979638d74c (patch) | |
tree | 482be4ec3410589975c7f51adb6e53af4b7b1807 | |
parent | af15570a6d911f5b90fbc6f6ecfc9db9cfddcba9 (diff) |
ccanlint: fix segfault caused by tests not depending on the "info" test.
These tests:
"depends-exist" (compulsory_tests/check_depends_exist.c)
"info-documentation" (tests/has_info_documentation.c)
used m->info_file without checking if it was NULL,
leading to a segfault when no _info file was present.
Some other tests also used m->info_file without depending on "info",
but are taken care of indirectly by this patch.
-rw-r--r-- | tools/ccanlint/compulsory_tests/check_depends_exist.c | 2 | ||||
-rw-r--r-- | tools/ccanlint/tests/has_info_documentation.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/ccanlint/compulsory_tests/check_depends_exist.c b/tools/ccanlint/compulsory_tests/check_depends_exist.c index d1f33b64..1423b40f 100644 --- a/tools/ccanlint/compulsory_tests/check_depends_exist.c +++ b/tools/ccanlint/compulsory_tests/check_depends_exist.c @@ -74,4 +74,4 @@ struct ccanlint depends_exist = { .check = check_depends_exist, }; -REGISTER_TEST(depends_exist, NULL); +REGISTER_TEST(depends_exist, &has_info, NULL); diff --git a/tools/ccanlint/tests/has_info_documentation.c b/tools/ccanlint/tests/has_info_documentation.c index ee89df9f..0a1788fd 100644 --- a/tools/ccanlint/tests/has_info_documentation.c +++ b/tools/ccanlint/tests/has_info_documentation.c @@ -96,4 +96,4 @@ struct ccanlint has_info_documentation = { .check = check_has_info_documentation, }; -REGISTER_TEST(has_info_documentation, NULL); +REGISTER_TEST(has_info_documentation, &has_info, NULL); |