All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Jarosch <thomas.jarosch@intra2net.com>
To: intel-gfx@lists.freedesktop.org
Subject: [intel-gpu-tools PATCH] Fix out of bounds memory access
Date: Tue, 25 Dec 2012 18:06:57 +0100	[thread overview]
Message-ID: <50D9DD31.4030601@intra2net.com> (raw)

cppcheck reported:
[tools/intel_infoframes.c:836]: (error) Width 31 given in format string
(no. 1) is larger than destination buffer 'option[16]',
use %15s to prevent overflowing it.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 tools/intel_infoframes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/intel_infoframes.c b/tools/intel_infoframes.c
index 66351ac..09fdcb9 100644
--- a/tools/intel_infoframes.c
+++ b/tools/intel_infoframes.c
@@ -833,7 +833,7 @@ static void change_spd_infoframe(Transcoder transcoder, char *commands)
 	val = INREG(reg);
 
 	while (1) {
-		rc = sscanf(current, "%31s%n", option, &read);
+		rc = sscanf(current, "%15s%n", option, &read);
 		current = &current[read];
 		if (rc == EOF) {
 			break;
-- 
1.7.11.7

             reply	other threads:[~2012-12-25 17:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-25 17:06 Thomas Jarosch [this message]
2013-01-06 17:21 ` [intel-gpu-tools PATCH] Fix out of bounds memory access Daniel Vetter

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=50D9DD31.4030601@intra2net.com \
    --to=thomas.jarosch@intra2net.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.