device_parser: fix out of bounds write

accept() expects the passed "scalar" to be 256 bytes long, so passing
the 80 char key will cause an out-of-range write.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2020-06-28 23:24:23 -07:00
parent 313780c7fd
commit e0dcdf1b53

View File

@@ -148,7 +148,7 @@ static void parse_board(struct device_parser *dp)
void device_parser(const char *path)
{
struct device_parser dp;
char key[80];
char key[TOKEN_LENGTH];
FILE *fh;
fh = fopen(path, "r");