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


test/x509_dup_cert_test.c:17:1: Parameter `n`
15.   #include "testutil.h"
16.   
17. > static int test_509_dup_cert(int n)
18.   {
19.       int ret = 0;

test/x509_dup_cert_test.c:23:26: Call
21.       X509_STORE *store = NULL;
22.       X509_LOOKUP *lookup = NULL;
23.       const char *cert_f = test_get_argument(n);
                               ^
24.   
25.       if (TEST_ptr(store = X509_STORE_new())

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, n), 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 test_509_dup_cert(int n)\n{\n    int ret = 0;\n    X509_STORE_CTX *sctx = NULL;\n    X509_STORE *store = NULL;\n    X509_LOOKUP *lookup = NULL;\n    const char *cert_f = test_get_argument(n);\n    if (TEST_ptr(store = X509_STORE_new())\n        && TEST_ptr(lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()))\n        && TEST_true(X509_load_cert_file(lookup, cert_f, X509_FILETYPE_PEM))\n        && TEST_true(X509_load_cert_file(lookup, cert_f, X509_FILETYPE_PEM)))\n        ret = 1;\n    X509_STORE_CTX_free(sctx);\n    X509_STORE_free(store);\n    return ret;\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}']