Skip to content

Commit

Permalink
tests: fix a uninitialized use warning
Browse files Browse the repository at this point in the history
Many, if not all, of the tests had an uninitialized use warning
relating to the use of the libseccomp context variable.

Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
pcmoore committed Feb 27, 2014
1 parent 655af28 commit 01c752a
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion tests/01-sim-allow.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/02-sim-basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/03-sim-basic_chains.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/04-sim-multilevel_chains.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/05-sim-long_jumps.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main(int argc, char *argv[])
int rc;
int iter;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/06-sim-actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/07-sim-db_bug_looping.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/08-sim-subtree_checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/09-sim-syscall_priority_pre.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/10-sim-syscall_priority_post.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/12-sim-basic_masked_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/13-basic-attrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char *argv[])
{
int rc;
uint32_t val = (uint32_t)(-1);
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

ctx = seccomp_init(SCMP_ACT_ALLOW);
if (ctx == NULL)
Expand Down
2 changes: 1 addition & 1 deletion tests/14-sim-reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/16-sim-arch_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/17-sim-arch_merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx_64, ctx_32;
scmp_filter_ctx ctx_64 = NULL, ctx_32 = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/18-sim-basic_whitelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/19-sim-missing_syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/20-live-basic_die.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
int action;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_action_parse(argv[1]);
if (rc == -1)
Expand Down
2 changes: 1 addition & 1 deletion tests/21-live-basic_allow.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
int main(int argc, char *argv[])
{
int rc;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_action_parse(argv[1]);
if (rc != SCMP_ACT_ALLOW) {
Expand Down
2 changes: 1 addition & 1 deletion tests/22-sim-basic_chains_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;
struct scmp_arg_cmp arg_cmp;

rc = util_getopt(argc, argv, &opts);
Expand Down
2 changes: 1 addition & 1 deletion tests/23-sim-arch_all_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/24-live-arg_allow.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char *argv[])
{
int rc;
int fd;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;
const char buf[] = "testing";
ssize_t buf_len = strlen(buf);

Expand Down
2 changes: 1 addition & 1 deletion tests/25-sim-multilevel_chains_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int argc, char *argv[])
{
int rc;
struct util_options opts;
scmp_filter_ctx ctx;
scmp_filter_ctx ctx = NULL;

rc = util_getopt(argc, argv, &opts);
if (rc < 0)
Expand Down

0 comments on commit 01c752a

Please sign in to comment.