Skip to contentSkip to conversation

'av.data' may be used uninitialized

DISCUSSION Michael Seyfert 2 participants 2 messages May 2, 2013 SELinux security module

lore
Share & tools
lore
#0 lore raw

When compiling libsepol with optimizations enabled I get this warning:

gcc -o hierarchy.o -c -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -D_GNU_SOURCE -O3 -I. -I/mnt/data/work/selinux/selinux/libsepol/include hierarchy.c hierarchy.c: In function 'check_avtab_hierarchy_callback':
hierarchy.c:234:2: error: 'av.data' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cc1: all warnings being treated as errors
scons: *** [hierarchy.o] Error 1
scons: building terminated because of errors.

I'm not familiar enough with the internals of selinux to know if this is a problem or not. Could someone look at it?

Signature · 1 line
Michael Seyfert
#1 lore raw
Quoted 11 lines · Michael Seyfert

When compiling libsepol with optimizations enabled I get this warning:

gcc -o hierarchy.o -c -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -D_GNU_SOURCE -O3 -I. -I/mnt/data/work/selinux/selinux/libsepol/include hierarchy.c hierarchy.c: In function 'check_avtab_hierarchy_callback':
hierarchy.c:234:2: error: 'av.data' may be used uninitialized in this function [-Werror=maybe-uninitialized]
cc1: all warnings being treated as errors
scons: *** [hierarchy.o] Error 1
scons: building terminated because of errors.

I'm not familiar enough with the internals of selinux to know if this is a problem or not. Could someone look at it?

Clever compiler isn't so clever. AFAICT the only way av.data would be uninitialized is if no parent types were found, which would cause the return 0 just above that ERR() line. I guess it could be initialized up top, even though that seems completely unnecessary.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.