Bug 6439 - legitimate used-uninitialized warning in tls-related code
legitimate used-uninitialized warning in tls-related code
Status: RESOLVED FIXED
Product: Samba 4.0
Classification: Unclassified
Component: Other
unspecified
Other Linux
: P3 normal
: ---
Assigned To: Andrew Bartlett
Andrew Bartlett
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-05 04:35 UTC by Jim Meyering
Modified: 2009-06-19 01:34 UTC (History)
1 user (show)

See Also:


Attachments
This fixes the uninitialized variables (5.19 KB, patch)
2009-06-15 15:30 UTC, Matthias Dieter Wallnöfer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Meyering 2009-06-05 04:35:13 UTC
git version: release-4-0-0alpha7-2044-gecd1fe2

Hi,

I did this with bleeding edge gcc (gcc version 4.5.0 20090601)

    cd source4 && ./configure --enable-developer && make

and it printed a bunch of used-uninitialized warnings:

lib/registry/regf.c:1730:137: warning: ‘offset’ may be used uninitialized in this function
dsdb/schema/schema_syntax.c:842:3: warning: ‘ret’ may be used uninitialized in this function
auth/kerberos/gssapi_parse.c:38:5: warning: ‘data’ is used uninitialized in this function
lib/tls/tls.c:577:2: warning: ‘cafile’ may be used uninitialized in this function
utils/ntlm_auth.c:493:4: warning: ‘mem_ctx’ may be used uninitialized in this function

I looked at the tls.c one and see that it is legitimate:
cafile is declared, and then used, but never initialized:

from source4/lib/tls/tls.c:

      char *cafile;
      ...
      gnutls_certificate_set_x509_trust_file(tls->xcred, cafile, GNUTLS_X509_FMT_PEM);
Comment 1 Matthias Dieter Wallnöfer 2009-06-12 14:46:06 UTC
A good catch, thanks! Any chance to look for default values of the mentioned variables to write a small patch?
Comment 2 Matthias Dieter Wallnöfer 2009-06-15 15:30:30 UTC
Created attachment 4291 [details]
This fixes the uninitialized variables
Comment 3 Matthias Dieter Wallnöfer 2009-06-19 01:34:08 UTC
Fixed