summaryrefslogtreecommitdiff
path: root/src/arch/x86
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/arch/x86
parent4b5012a4a2bf804d395ae3a72c76f50c4a9189db (diff)
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/arch/x86')
-rw-r--r--src/arch/x86/boot/acpigen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/x86/boot/acpigen.c b/src/arch/x86/boot/acpigen.c
index 121cb22f05..6496d759de 100644
--- a/src/arch/x86/boot/acpigen.c
+++ b/src/arch/x86/boot/acpigen.c
@@ -274,7 +274,8 @@ int acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len)
acpigen_emit_byte(0x83);
len = acpigen_write_len_f();
- sprintf(pscope, "\\_PR.CPU%x", (unsigned int) cpuindex);
+ snprintf(pscope, sizeof (pscope),
+ "\\_PR.CPU%x", (unsigned int) cpuindex);
len += acpigen_emit_namestring(pscope);
acpigen_emit_byte(cpuindex);
acpigen_emit_byte(pblock_addr & 0xff);