[SSSD] [PATCH]Fix uninitialized values

Jakub Hrozek jhrozek at redhat.com
Wed Jul 18 18:09:49 UTC 2012


On Wed, Jul 18, 2012 at 07:03:00PM +0200, Pavel Březina wrote:
> On 18.7.2012 18:13, Nick Guay wrote:
> >On 18/07/12 06:44, Pavel Březina wrote:
> >>On 07/17/2012 11:21 PM, Nick Guay wrote:
> >>>On 17/07/12 16:09, Jakub Hrozek wrote:
> >>>>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.
> >>>>_______________________________________________
> >>>>sssd-devel mailing list
> >>>>sssd-devel at lists.fedorahosted.org
> >>>>https://fedorahosted.org/mailman/listinfo/sssd-devel
> >>>I didn't catch those extra ones. Added those plus one more seen at -O3.
> >>>None of the uninitialized variables seem critical or segfault worthy.
> >>
> >>Hi,
> >>there are still some warning left.
> >>
> >>src/providers/ldap/sdap_sudo.c: In function 'sdap_sudo_reply':
> >>src/providers/ldap/sdap_sudo.c:466:22: warning: 'error' may be used
> >>uninitialized in this function [-Wuninitialized]
> >>src/providers/ldap/sdap_sudo.c:466:22: warning: 'dp_error' may be used
> >>uninitialized in this function [-Wuninitialized]
> >>src/providers/ldap/sdap_sudo.c: In function
> >>'sdap_sudo_periodical_first_refresh_done':
> >>src/providers/ldap/sdap_sudo.c:942:973: warning: 'error' may be used
> >>uninitialized in this function [-Wuninitialized]
> >>src/providers/ldap/sdap_sudo.c:942:973: warning: 'dp_error' may be
> >>used uninitialized in this function [-Wuninitialized]
> >>src/providers/ldap/sdap_sudo.c: In function
> >>'sdap_sudo_periodical_full_refresh_done':
> >>src/providers/ldap/sdap_sudo.c:1001:973: warning: 'error' may be used
> >>uninitialized in this function [-Wuninitialized]
> >>src/providers/ldap/sdap_sudo.c:1001:973: warning: 'dp_error' may be
> >>used uninitialized in this function [-Wuninitialized]
> >>src/responder/nss/nsssrv_services.c: In function ‘fill_service.isra.1’:
> >>src/responder/nss/nsssrv_services.c:764:24: warning: ‘num’ may be used
> >>uninitialized in this function [-Wuninitialized]
> >>src/responder/nss/nsssrv_services.c:600:18: note: ‘num’ was declared here
> >>
> >>Compiled with:
> >>-m64 -mtune=generic -O3 -D_FORTIFY_SOURCE=2 -fstack-protector-all
> >>-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter
> >>
> >
> >Patch rebased and fixed additional uninitialized variables.
> 
> Ack!

Pushed to master.



More information about the sssd-devel mailing list