mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-02 11:42:05 +00:00
checkpolicy: avoid potential use of uninitialized variable
checkpolicy.c: In function ‘main’: checkpolicy.c:1000:25: error: ‘tsid’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1000 | printf("if_sid %d default_msg_sid %d\n", ssid, tsid); | ^ checkpolicy.c: In function ‘main’: checkpolicy.c:971:25: error: ‘tsid’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 971 | printf("fs_sid %d default_file_sid %d\n", ssid, tsid); | ^ Found by GCC 11 with LTO enabled. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
parent
5a10f05f53
commit
5218bf4b26
@ -970,8 +970,12 @@ int main(int argc, char **argv)
|
||||
printf("fs kdevname? ");
|
||||
FGETS(ans, sizeof(ans), stdin);
|
||||
ans[strlen(ans) - 1] = 0;
|
||||
sepol_fs_sid(ans, &ssid, &tsid);
|
||||
printf("fs_sid %d default_file_sid %d\n", ssid, tsid);
|
||||
ret = sepol_fs_sid(ans, &ssid, &tsid);
|
||||
if (ret) {
|
||||
printf("unknown fs kdevname\n");
|
||||
} else {
|
||||
printf("fs_sid %d default_file_sid %d\n", ssid, tsid);
|
||||
}
|
||||
break;
|
||||
case '9':
|
||||
printf("protocol? ");
|
||||
@ -999,8 +1003,12 @@ int main(int argc, char **argv)
|
||||
printf("netif name? ");
|
||||
FGETS(ans, sizeof(ans), stdin);
|
||||
ans[strlen(ans) - 1] = 0;
|
||||
sepol_netif_sid(ans, &ssid, &tsid);
|
||||
printf("if_sid %d default_msg_sid %d\n", ssid, tsid);
|
||||
ret = sepol_netif_sid(ans, &ssid, &tsid);
|
||||
if (ret) {
|
||||
printf("unknown name\n");
|
||||
} else {
|
||||
printf("if_sid %d default_msg_sid %d\n", ssid, tsid);
|
||||
}
|
||||
break;
|
||||
case 'b':{
|
||||
char *p;
|
||||
|
Loading…
Reference in New Issue
Block a user