mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kylene Jo Hall <kjhall@us.ibm.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: akpm@osdl.org, Serge Hallyn <sergeh@us.ibm.com>,
	Mimi Zohar <zohar@us.ibm.com>, Dave Safford <safford@us.ibm.com>,
	sds@tycho.nsa.gov
Subject: [PATCH] slim: correct use of snprintf
Date: Wed, 20 Sep 2006 09:48:54 -0700	[thread overview]
Message-ID: <1158770934.16727.114.camel@localhost.localdomain> (raw)

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);



                 reply	other threads:[~2006-09-20 16:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1158770934.16727.114.camel@localhost.localdomain \
    --to=kjhall@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=safford@us.ibm.com \
    --cc=sds@tycho.nsa.gov \
    --cc=sergeh@us.ibm.com \
    --cc=zohar@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®