#fixed code
                              @Test
  public void test() throws Exception {
    startDefaultMaster();

    final String id = "test-" + toHexString(new SecureRandom().nextInt());
    final String namespace = "helios-" + id;
    final String intruder1 = intruder(namespace);
    final String intruder2 = intruder(namespace);

    // Start a container in the agent namespace
    startContainer(intruder1);

    // Start agent
    final HeliosClient client = defaultClient();
    startDefaultAgent(testHost(), "--id=" + id);
    awaitHostRegistered(client, testHost(), LONG_WAIT_SECONDS, SECONDS);
    awaitHostStatus(client, testHost(), UP, LONG_WAIT_SECONDS, SECONDS);

    // With LXC, killing a container results in exit code 0.
    // In docker 1.5 killing a container results in exit code 137, in previous versions it's -1.
    final String executionDriver = docker.info().executionDriver();
    final List<Integer> expectedExitCodes =
        (executionDriver != null && executionDriver.startsWith("lxc-"))
        ? Collections.singletonList(0) : asList(-1, 137);

    // Wait for the agent to kill the container
    final ContainerExit exit1 = docker.waitContainer(intruder1);
    assertThat(exit1.statusCode(), isIn(expectedExitCodes));

    // Start another container in the agent namespace
    startContainer(intruder2);

    // Wait for the agent to kill the second container as well
    final ContainerExit exit2 = docker.waitContainer(intruder2);
    assertThat(exit2.statusCode(), isIn(expectedExitCodes));
  }
#vulnerable code 
                              @Test
  public void test() throws Exception {
    startDefaultMaster();

    final String id = "test-" + toHexString(new SecureRandom().nextInt());
    final String namespace = "helios-" + id;
    final String intruder1 = intruder(namespace);
    final String intruder2 = intruder(namespace);

    // Start a container in the agent namespace
    startContainer(intruder1);

    // Start agent
    final HeliosClient client = defaultClient();
    startDefaultAgent(testHost(), "--id=" + id);
    awaitHostRegistered(client, testHost(), LONG_WAIT_SECONDS, SECONDS);
    awaitHostStatus(client, testHost(), UP, LONG_WAIT_SECONDS, SECONDS);

    // With LXC, killing a container results in exit code 0.
    // In docker 1.5 killing a container results in exit code 137, in previous versions it's -1.
    final List<Integer> expectedExitCodes = docker.info().executionDriver().startsWith("lxc-")
                                            ? Collections.singletonList(0) : asList(-1, 137);

    // Wait for the agent to kill the container
    final ContainerExit exit1 = docker.waitContainer(intruder1);
    assertThat(exit1.statusCode(), isIn(expectedExitCodes));

    // Start another container in the agent namespace
    startContainer(intruder2);

    // Wait for the agent to kill the second container as well
    final ContainerExit exit2 = docker.waitContainer(intruder2);
    assertThat(exit2.statusCode(), isIn(expectedExitCodes));
  } 
                            #location 21 
                            #vulnerability type NULL_DEREFERENCE