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>
This commit is contained in:
Vladimir Serbinenko
2013-11-26 02:41:26 +01:00
parent 4b5012a4a2
commit a37383db80
18 changed files with 70 additions and 60 deletions

View File

@@ -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;
}