uninitialized values in setfiles/psid.c
PATCH 1/1 uninitialized values in setfiles/psid.c
While updating to the newer policycoreutils release, I noticed the following gcc warnings:
psid.c: In function `chpsid':
psid.c:609: warning: off' might be used uninitialized in this function psid.c:610: warning: len' might be used uninitialized in this function
I believe the patch below should fix the problem.
psid.c renamed from psid.c~ +5 -3
@@ -658,10 +658,12 @@*/ DPRINTF ("chpsid: adding new entry to contexts\n" ); - rc =lseek (t->contexts_fp,0 ,SEEK_END ); -if (rc <0 ) { + len =strlen (context)+1 ; + + off =lseek (t->contexts_fp,0 ,SEEK_END ); +if (off <0 ) {perror ("lseek" ); -return rc; +return off; } rc =write (t->contexts_fp, context, len);if (rc <0 ) {
Quoted 8 lines · Colin Walters
While updating to the newer policycoreutils release, I noticed the following gcc warnings:
psid.c: In function `chpsid':
psid.c:609: warning:off' might be used uninitialized in this function psid.c:610: warning:len' might be used uninitialized in this functionI believe the patch below should fix the problem.
The psid code in setfiles is actually obsolete now, and can be dropped.
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- 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.
Quoted 8 lines · Colin Walters
While updating to the newer policycoreutils release, I noticed the following gcc warnings:
psid.c: In function `chpsid':
psid.c:609: warning:off' might be used uninitialized in this function psid.c:610: warning:len' might be used uninitialized in this functionI believe the patch below should fix the problem.
A patch removing the obsolete psid code from setfiles has been committed to the sourceforge CVS tree.
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- 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.