[SSSD] [PATCH] LDAP: Fix value initialization warnings

Jakub Hrozek jhrozek at redhat.com
Thu Apr 4 09:31:29 UTC 2013


On Thu, Apr 04, 2013 at 11:17:05AM +0200, Jakub Hrozek wrote:
> On Thu, Apr 04, 2013 at 08:57:03AM +0200, Lukas Slebodnik wrote:
> > On (03/04/13 14:13), Lukas Slebodnik wrote:
> > >hi,
> > >
> > >There are no more any warnings in fedora 19 with attached patches.
> > >I think, that they are false positive, but I don't like warnings.
> > >
> > >LS
> > 
> > I found another initialization bug, but I am not sure, how to fix it.
> > src/providers/ipa/ipa_dyndns.c: In function 'ipa_dyndns_update_send':
> > src/providers/ipa/ipa_dyndns.c:245:39: warning: 'state' is used uninitialized in this function [-Wuninitialized]
> > 
> > In file src/providers/ipa/ipa_dyndns.c
> >    234  static struct tevent_req *
> >    235  ipa_dyndns_update_send(struct ipa_options *ctx)
> >    236  {
> >    237      int ret;
> >    238      char *iface;
> >    239      struct ipa_dyndns_ctx *state;
> >    240      struct ifaddrs *ifaces;
> >    241      struct ifaddrs *ifa;
> >    242      struct ipa_ipaddress *address;
> >    243      struct tevent_req *req, *subreq;
> >    244      size_t addrsize;
> >    245      struct sdap_id_ctx *id_ctx = state->ipa_ctx->id_ctx->sdap_id_ctx;
> >                                          ^^^^^
> >                                       this could not work
> > 
> > Introduced in patch:584eda08 Jakub Hrozek      2013-03-25 22:54:48 +0100
> > 
> > LS
> 
> Oh, wonderful. This code will go away with the new dyndns patches
> anyway, so I can either fix it now with a separate patch or send the
> whole bunch.

Let's fix in now, that's a crasher bug. Sorry, the whole dyndns branch
works in my tree because I had another patches on top.
-------------- next part --------------
>From a11bbbd77a683269b41d0678c61a0d339e4923d6 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Thu, 4 Apr 2013 11:30:44 +0200
Subject: [PATCH] dyndns: Fix initializing sdap_id_ctx

---
 src/providers/ipa/ipa_dyndns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c
index a31067cdc09cfac24ff7ab9fabb3cf4f6b742b74..0bd8ad002c82fdfce6834c9b0209a8b69536a7bf 100644
--- a/src/providers/ipa/ipa_dyndns.c
+++ b/src/providers/ipa/ipa_dyndns.c
@@ -242,7 +242,7 @@ ipa_dyndns_update_send(struct ipa_options *ctx)
     struct ipa_ipaddress *address;
     struct tevent_req *req, *subreq;
     size_t addrsize;
-    struct sdap_id_ctx *id_ctx = state->ipa_ctx->id_ctx->sdap_id_ctx;
+    struct sdap_id_ctx *id_ctx = ctx->id_ctx->sdap_id_ctx;
 
     DEBUG (9, ("Performing update\n"));
 
-- 
1.8.1.4



More information about the sssd-devel mailing list