slim: correct use of snprintf
PATCH 1/1 slim: correct use of snprintf
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 <[email protected]>
Signed-off-by Mimi Zohar <[email protected]>
---security/slim/slm_secfs.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
security/slim/slm_secfs.c +4 -4
@@ -28,16 +28,16 @@ static ssize_t slm_read_level(struct filssize_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);