提交 62c9b960 编写于 作者: V Valentin Longchamp 提交者: Prafulla Wadaskar

km/ivm: fix string len check to support 7 char board names

The fanless boards now have a 7-digit (XXXXX-F) board name. This
triggers a border condition when reading this string in the IVM although
this string is smaller than the currenly read string size, but only by 1
character.

This patch corrects this by changing the size check condition for string
length. It is the same change that was done in the platform for this
same bug.
Signed-off-by: NValentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Stefan Bigler <stefan.bigler@keymile.com>
上级 8203b201
......@@ -163,7 +163,7 @@ static int ivm_findinventorystring(int type,
if (addr == INVENTORYDATASIZE) {
xcode = -1;
printf("Error end of string not found\n");
} else if ((size >= (maxlen - 1)) &&
} else if ((size > (maxlen - 1)) &&
(buf[addr] != '\r')) {
xcode = -1;
printf("string too long till next CR\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册