test/bntest.c:2238: error: BUFFER_OVERRUN_L2
  Offset: [max(0, `i`), 399] Size: 100 by call to `test_get_argument`.
Showing all 7 steps of the trace


test/bntest.c:2235:1: Parameter `i`
2233.   }
2234.   
2235. > static int run_file_tests(int i)
2236.   {
2237.       STANZA *s = NULL;

test/bntest.c:2238:22: Call
2236.   {
2237.       STANZA *s = NULL;
2238.       char *testfile = test_get_argument(i);
                             ^
2239.       int c;
2240.   

test/testutil/options.c:24:1: <Offset trace>
22.   }
23.   
24. > char *test_get_argument(size_t n)
25.   {
26.       char **argv = opt_rest();

test/testutil/options.c:24:1: Parameter `n`
  22.   }
  23.   
  24. > char *test_get_argument(size_t n)
  25.   {
  26.       char **argv = opt_rest();

test/testutil/options.c:16:1: <Length trace>
14.   
15.   
16. > static int used[100] = { 0 };
17.   
18.   

test/testutil/options.c:16:1: Array declaration
  14.   
  15.   
  16. > static int used[100] = { 0 };
  17.   
  18.   

test/testutil/options.c:31:5: Array access: Offset: [max(0, i), 399] Size: 100 by call to `test_get_argument` 
  29.       if ((int)n >= opt_num_rest() || argv == NULL)
  30.           return NULL;
  31.       used[n] = 1;
            ^
  32.       return argv[n];
  33.   }

char *test_get_argument(size_t n)
{
    char **argv = opt_rest();
    OPENSSL_assert(n < sizeof(used));
    if ((int)n >= opt_num_rest() || argv == NULL)
        return NULL;
    used[n] = 1;
    return argv[n];
}
['static int run_file_tests(int i)\n{\n    STANZA *s = NULL;\n    char *testfile = test_get_argument(i);\n    int c;\n    if (!TEST_ptr(s = OPENSSL_zalloc(sizeof(*s))))\n        return 0;\n    if (!test_start_file(s, testfile)) {\n        OPENSSL_free(s);\n        return 0;\n    }\n    while (!BIO_eof(s->fp) && test_readstanza(s)) {\n        if (s->numpairs == 0)\n            continue;\n        if (!file_test_run(s))\n            s->errors++;\n        s->numtests++;\n        test_clearstanza(s);\n    }\n    test_end_file(s);\n    c = s->errors;\n    OPENSSL_free(s);\n    return c == 0;\n}', 'char *test_get_argument(size_t n)\n{\n    char **argv = opt_rest();\n    OPENSSL_assert(n < sizeof(used));\n    if ((int)n >= opt_num_rest() || argv == NULL)\n        return NULL;\n    used[n] = 1;\n    return argv[n];\n}']