summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2013-11-26 02:41:26 +0100
committerVladimir Serbinenko <phcoder@gmail.com>2014-01-10 18:08:16 +0100
commita37383db8081b66eafc3860ede23edbfd39ac8ad (patch)
tree3f793f4b2342aa440efe3fa649244ec064ced5d8 /src/mainboard
parent4b5012a4a2bf804d395ae3a72c76f50c4a9189db (diff)
downloadcoreboot-a37383db8081b66eafc3860ede23edbfd39ac8ad.tar.xz
Replace all occurences of sprintf with snprintf
THis reduces risks of bufer overflows. Change-Id: I77f80e76efec16ac0a0af83d76430a8126a7602d Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4279 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/link/i915.c2
-rw-r--r--src/mainboard/google/stout/i915.c2
-rw-r--r--src/mainboard/intel/wtm2/i915.c2
-rw-r--r--src/mainboard/lenovo/x60/i915.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/mainboard/google/link/i915.c b/src/mainboard/google/link/i915.c
index 64812349ed..a38760b1a5 100644
--- a/src/mainboard/google/link/i915.c
+++ b/src/mainboard/google/link/i915.c
@@ -78,7 +78,7 @@ const u32 link_edid_data[] = {
static char *regname(unsigned long addr)
{
static char name[16];
- sprintf(name, "0x%lx", addr);
+ snprintf(name, sizeof (name), "0x%lx", addr);
return name;
}
diff --git a/src/mainboard/google/stout/i915.c b/src/mainboard/google/stout/i915.c
index 89a8594e54..8085de6554 100644
--- a/src/mainboard/google/stout/i915.c
+++ b/src/mainboard/google/stout/i915.c
@@ -88,7 +88,7 @@ setgtt(int start, int end, unsigned long base, int inc)
static char *regname(unsigned long addr)
{
static char name[16];
- sprintf(name, "0x%lx", addr);
+ snprintf(name, sizeof (name), "0x%lx", addr);
return name;
}
diff --git a/src/mainboard/intel/wtm2/i915.c b/src/mainboard/intel/wtm2/i915.c
index df8813888f..b664c35ebf 100644
--- a/src/mainboard/intel/wtm2/i915.c
+++ b/src/mainboard/intel/wtm2/i915.c
@@ -88,7 +88,7 @@ static int ioread = 0, iowrite = 0;
static char *regname(unsigned long addr)
{
static char name[16];
- sprintf(name, "0x%lx", addr);
+ snprintf(name, sizeof (name), "0x%lx", addr);
return name;
}
diff --git a/src/mainboard/lenovo/x60/i915.c b/src/mainboard/lenovo/x60/i915.c
index 0d3267296e..ea01ef1380 100644
--- a/src/mainboard/lenovo/x60/i915.c
+++ b/src/mainboard/lenovo/x60/i915.c
@@ -80,7 +80,7 @@ const u32 x60_edid_data[] = {
static char *regname(unsigned long addr)
{
static char name[16];
- sprintf(name, "0x%lx", addr);
+ snprintf(name, sizeof (name), "0x%lx", addr);
return name;
}