[SSSD] [PATCH]Fix uninitialized values

Jakub Hrozek jhrozek at redhat.com
Tue Jul 17 20:09:10 UTC 2012


On Mon, Jul 16, 2012 at 04:41:22PM -0400, Nick Guay wrote:
> Patch for uninitialized values when building with -Wmaybe-uninitialized.
> 

Hi Nick,

the patch fixes most of the warnings, but I still saw a couple:

src/db/sysdb_sudo.c: In function 'sysdb_get_sudo_user_info':
src/db/sysdb_sudo.c:349:15: warning: 'uid' may be used uninitialized in
this function [-Wmaybe-uninitialized]
src/providers/ldap/sdap_async_sudo.c: In function
'sdap_sudo_load_sudoers_done':
src/providers/ldap/sdap_async_sudo.c:599:9: warning: 'rules_count' may
be used uninitialized in this function [-Wmaybe-uninitialized]
src/providers/ldap/sdap_async_sudo.c:463:12: note: 'rules_count' was
declared here
src/responder/sudo/sudosrv_dp.c: In function ‘sss_dp_get_sudoers_send’:
src/responder/sudo/sudosrv_dp.c:97:9: warning: ‘key’ may be used
uninitialized in this function [-Wmaybe-uninitialized]

The sudo support was rewritten quite recently, so perhaps the patch just
needs amending?

For the record, I was compiling with:
$ echo $CFLAGS
-O2 -ggdb -pipe -Wall -Wextra -Werror=unused-function -Wunused-variable
-Wno-unused-parameter -Wno-sign-compare -Wmaybe-uninitialized
-fexceptions -fstack-protector --param=ssp-buffer-size=4

GCC was silent about most of the warnings even with -O0, I had to bump
optimizations to -O2 to see them.



More information about the sssd-devel mailing list