mirror of
https://git.busybox.net/busybox
synced 2026-01-26 16:17:50 +00:00
selinux: fix potential segfault in sestatus
Remove the puts(cterm) call that was likely leftover debugging code. The controlling terminal name is already properly displayed via the 'Controlling term:' label, so the raw terminal name output was redundant and could cause issues when cterm is NULL. Also add proper cleanup for the allocated cterm string. function old new delta ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
9443b0bc5e
commit
552003dbd6
1 changed files with 2 additions and 2 deletions
|
|
@ -131,13 +131,13 @@ static void display_verbose(void)
|
|||
puts("\nFile contexts:");
|
||||
|
||||
cterm = xmalloc_ttyname(0);
|
||||
//FIXME: if cterm == NULL, we segfault!??
|
||||
puts(cterm);
|
||||
if (cterm && lgetfilecon(cterm, &con) >= 0) {
|
||||
printf(COL_FMT "%s\n", "Controlling term:", con);
|
||||
if (ENABLE_FEATURE_CLEAN_UP)
|
||||
freecon(con);
|
||||
}
|
||||
if (ENABLE_FEATURE_CLEAN_UP)
|
||||
free(cterm);
|
||||
|
||||
for (i = 0; fc[i] != NULL; i++) {
|
||||
struct stat stbuf;
|
||||
|
|
|
|||
Loading…
Reference in a new issue