[SSSD] [PATCH]Fix uninitialized values

Nick Guay nguay at redhat.com
Tue Jul 17 21:21:27 UTC 2012


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-uninitialized-values.patch
Type: text/x-patch
Size: 7391 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120717/046ec2c5/attachment.bin>


More information about the sssd-devel mailing list