util/broadcom: Terminate string
filebuffer is treated like a string, so it should be zero-terminated like a string. Change-Id: I078aa39906394be64023424731fe0c7ae2019899 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1323473 Reviewed-on: https://review.coreboot.org/17878 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
5f771dca27
commit
856a3ab7c7
|
@ -15,7 +15,7 @@
|
|||
#include <string.h>
|
||||
#include "secimage.h"
|
||||
|
||||
static unsigned char filebuffer[2048];
|
||||
static unsigned char filebuffer[2049];
|
||||
|
||||
void FillHeaderFromConfigFile(char *h, char *ConfigFileName)
|
||||
{
|
||||
|
@ -32,6 +32,7 @@ void FillHeaderFromConfigFile(char *h, char *ConfigFileName)
|
|||
if (fp != NULL) {
|
||||
printf("\r\n Reading config information from file \r\n");
|
||||
byte_count = fread(filebuffer, 1, 2048, fp);
|
||||
filebuffer[2048] = 0;
|
||||
if (byte_count > 0) {
|
||||
ptr = strstr((char *)filebuffer, "Tag=");
|
||||
if (ptr) {
|
||||
|
|
Loading…
Reference in New Issue