* [PATCH] slim: correct use of snprintf
@ 2006-09-20 16:48 Kylene Jo Hall
0 siblings, 0 replies; only message in thread
From: Kylene Jo Hall @ 2006-09-20 16:48 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, Serge Hallyn, Mimi Zohar, Dave Safford, sds
Thanks to Stephen Smalley for pointing our incorrect usage of snprintf.
This patch fixes things by using the correct function, scnprintf,
instead.
Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
---
security/slim/slm_secfs.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
--- linux-2.6.18-rc6-orig/security/slim/slm_secfs.c 2006-09-18 16:41:48.000000000 -0500
+++ linux-2.6.18-rc6/security/slim/slm_secfs.c 2006-09-19 13:07:05.000000000 -0500
@@ -28,16 +28,16 @@ static ssize_t slm_read_level(struct fil
ssize_t len;
char data[28];
if (is_kernel_thread(current))
- len = snprintf(data, sizeof(data), "KERNEL\n");
+ len = scnprintf(data, sizeof(data), "KERNEL\n");
else if (!cur_tsec)
- len = snprintf(data, sizeof(data), "UNKNOWN\n");
+ len = scnprintf(data, sizeof(data), "UNKNOWN\n");
else {
if (cur_tsec->iac_wx != cur_tsec->iac_r)
- len = snprintf(data, sizeof(data), "GUARD wx:%s r:%s\n",
+ len = scnprintf(data, sizeof(data), "GUARD wx:%s r:%s\n",
slm_iac_str[cur_tsec->iac_wx],
slm_iac_str[cur_tsec->iac_r]);
else
- len = snprintf(data, sizeof(data), "%s\n",
+ len = scnprintf(data, sizeof(data), "%s\n",
slm_iac_str[cur_tsec->iac_wx]);
}
return simple_read_from_buffer(buf, buflen, ppos, data, len);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-20 16:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-20 16:48 [PATCH] slim: correct use of snprintf Kylene Jo Hall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®