[PATCH] libsepol: sepol_av_to_string: clear static buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



chenxiaolong reported this via
https://github.com/SELinuxProject/selinux/issues/23

A nicer fix would be to rework the interface to be more
like security_av_string() in libselinux, but that requires
updating all callers.

Signed-off-by: Stephen Smalley <sds@xxxxxxxxxxxxx>
---
 libsepol/src/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libsepol/src/util.c b/libsepol/src/util.c
index ff8f7f2..b00251c 100644
--- a/libsepol/src/util.c
+++ b/libsepol/src/util.c
@@ -89,6 +89,7 @@ char *sepol_av_to_string(policydb_t * policydbp, uint32_t tclass,
 	int rc;
 	int avlen = 0, len;
 
+	memset(avbuf, 0, sizeof avbuf);
 	cladatum = policydbp->class_val_to_struct[tclass - 1];
 	p = avbuf;
 	for (i = 0; i < cladatum->permissions.nprim; i++) {
-- 
2.7.4

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux