test/stack_test.c:312: error: UNINITIALIZED_VALUE
  The value read from v[_] was never initialized.
Showing all 1 steps of the trace


test/stack_test.c:312:13: 
310.       for (i = 0; i < n; i++) {
311.           p = sk_SS_value(r, i);
312. >         if (p == v[i]) {
313.               fprintf(stderr, "test SS deepcopy non-copy %d\n", i);
314.               goto end;

static int test_SS_stack(void)
{
    STACK_OF(SS) *s = sk_SS_new_null();
    STACK_OF(SS) *r = NULL;
    SS *v[10], *p;
    const int n = OSSL_NELEM(v);
    int i;
    int testresult = 0;
    for (i = 0; i < n; i++) {
        v[i] = OPENSSL_malloc(sizeof(*v[i]));
        if (v[i] == NULL) {
            fprintf(stderr, "test SS memory allocation failure\n");
            goto end;
        }
        v[i]->n = i;
        v[i]->c = 'A' + i;
        if (sk_SS_num(s) != i) {
            fprintf(stderr, "test SS stack size %d\n", i);
            goto end;
        }
        sk_SS_push(s, v[i]);
    }
    if (sk_SS_num(s) != n) {
        fprintf(stderr, "test SS size %d\n", n);
        goto end;
    }
    r = sk_SS_deep_copy(s, &SS_copy, &SS_free);
    if (r == NULL) {
        fprintf(stderr, "test SS deepcopy failure\n");
        goto end;
    }
    for (i = 0; i < n; i++) {
        p = sk_SS_value(r, i);
        if (p == v[i]) {
            fprintf(stderr, "test SS deepcopy non-copy %d\n", i);
            goto end;
        }
        if (p->n != v[i]->n || p->c != v[i]->c) {
            fprintf(stderr, "test SS deepcopy values %d\n", i);
            goto end;
        }
    }
    sk_SS_pop_free(r, &SS_free);
    r = NULL;
    if ((p = sk_SS_delete_ptr(s, v[3])) == NULL) {
        fprintf(stderr, "test SS delete ptr not found\n");
        goto end;
    }
    SS_free(p);
    if (sk_SS_num(s) != n-1) {
        fprintf(stderr, "test SS delete ptr size\n");
        goto end;
    }
    for (i = 0; i < n-1; i++)
        if (sk_SS_value(s, i) != v[i<3 ? i : 1+i]) {
            fprintf(stderr, "test SS delete ptr item %d\n", i);
            goto end;
        }
    testresult = 1;
end:
    sk_SS_pop_free(r, &SS_free);
    sk_SS_pop_free(s, &SS_free);
    return testresult;
}
['static int test_SS_stack(void)\n{\n    STACK_OF(SS) *s = sk_SS_new_null();\n    STACK_OF(SS) *r = NULL;\n    SS *v[10], *p;\n    const int n = OSSL_NELEM(v);\n    int i;\n    int testresult = 0;\n    for (i = 0; i < n; i++) {\n        v[i] = OPENSSL_malloc(sizeof(*v[i]));\n        if (v[i] == NULL) {\n            fprintf(stderr, "test SS memory allocation failure\\n");\n            goto end;\n        }\n        v[i]->n = i;\n        v[i]->c = \'A\' + i;\n        if (sk_SS_num(s) != i) {\n            fprintf(stderr, "test SS stack size %d\\n", i);\n            goto end;\n        }\n        sk_SS_push(s, v[i]);\n    }\n    if (sk_SS_num(s) != n) {\n        fprintf(stderr, "test SS size %d\\n", n);\n        goto end;\n    }\n    r = sk_SS_deep_copy(s, &SS_copy, &SS_free);\n    if (r == NULL) {\n        fprintf(stderr, "test SS deepcopy failure\\n");\n        goto end;\n    }\n    for (i = 0; i < n; i++) {\n        p = sk_SS_value(r, i);\n        if (p == v[i]) {\n            fprintf(stderr, "test SS deepcopy non-copy %d\\n", i);\n            goto end;\n        }\n        if (p->n != v[i]->n || p->c != v[i]->c) {\n            fprintf(stderr, "test SS deepcopy values %d\\n", i);\n            goto end;\n        }\n    }\n    sk_SS_pop_free(r, &SS_free);\n    r = NULL;\n    if ((p = sk_SS_delete_ptr(s, v[3])) == NULL) {\n        fprintf(stderr, "test SS delete ptr not found\\n");\n        goto end;\n    }\n    SS_free(p);\n    if (sk_SS_num(s) != n-1) {\n        fprintf(stderr, "test SS delete ptr size\\n");\n        goto end;\n    }\n    for (i = 0; i < n-1; i++)\n        if (sk_SS_value(s, i) != v[i<3 ? i : 1+i]) {\n            fprintf(stderr, "test SS delete ptr item %d\\n", i);\n            goto end;\n        }\n    testresult = 1;\nend:\n    sk_SS_pop_free(r, &SS_free);\n    sk_SS_pop_free(s, &SS_free);\n    return testresult;\n}']