mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: util/broadcom: Terminate string
filebuffer is treated like a string, so it should be zero-terminated like a string. Change-Id: I078aa39906394be64023424731fe0c7ae2019899 Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Found-by: Coverity Scan #1323473 Original-Reviewed-on: https://review.coreboot.org/17878 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Martin Roth <martinroth@google.com> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/421212 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
parent
c35186c9aa
commit
bcefbf84ce
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue