#728 Uninitialized value error in setup_test in fail_over-tests.c
Closed: Fixed None Opened 13 years ago by sgallagh.

   59static struct test_ctx *
   60setup_test(void)
   61{
   62    struct test_ctx *ctx;
Declaring variable "fopts" without initializer.
   63    struct fo_options fopts;
   64    int ret;
   65
   66    ctx = talloc_zero(global_talloc_context, struct test_ctx);
At conditional (1): "!(ctx == NULL)" taking the true branch.
   67    fail_if(ctx == NULL, "Could not allocate memory for test context");
   68
   69    ctx->ev = tevent_context_init(ctx);
At conditional (2): "ctx->ev == NULL" taking the true branch.
   70    if (ctx->ev == NULL) {
   71        talloc_free(ctx);
   72        fail("Could not init tevent context");
   73    }
   74
   75    ret = resolv_init(ctx, ctx->ev, 5, &ctx->resolv);
At conditional (3): "ret != 0" taking the false branch.
   76    if (ret != EOK) {
   77        talloc_free(ctx);
   78        fail("Could not init resolv context");
   79    }
   80
   81    fopts.retry_timeout = 30;
   82    fopts.family_order  = IPV4_FIRST;
   83
Using uninitialized value "fopts.srv_retry_timeout" when calling "fo_context_init". [show details]
   84    ctx->fo_ctx = fo_context_init(ctx, &fopts);
   85    if (ctx->fo_ctx == NULL) {
   86        talloc_free(ctx);
   87        fail("Could not init fail over context");
   88    }

We're not setting fopts.srv_retry_timeout before using it in the test.


Fields changed

keywords: => Coverity
milestone: NEEDS_TRIAGE => SSSD 1.5.1

Fixed by 7114284

coverity: => 10024
milestone: SSSD 1.5.1 => SSSD 1.5.0
resolution: => fixed
status: new => closed

Fields changed

rhbz: => 0

Metadata Update from @sgallagh:
- Issue assigned to sbose
- Issue set to the milestone: SSSD 1.5.0

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/1770

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata