amdfwtool: Clear struct match before regular expression matching
commit4df5af87bea4761a35415caab7f85658ee0d0ea1
authorZheng Bao <fishbaozi@gmail.com>
Tue, 1 Mar 2022 09:18:00 +0000 (1 17:18 +0800)
committerFelix Held <felix-coreboot@felixheld.de>
Wed, 9 Mar 2022 14:02:21 +0000 (9 14:02 +0000)
treecab7afa7ccbaa54b8278ceec4d7819d1296837c8
parent0e545b252da4bf0f017b29572cfc4e2d80db313b
amdfwtool: Clear struct match before regular expression matching

If it is not cleared and the number of strings is fewer than last
iteration, the match[3] will keep the last value, which actually
should be empty.

Add assert to make sure the level is a legal value.

BUG=b:222038278

Change-Id: If14e0923fbb1648d83784eb5dc1411c93227db5a
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62482
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
util/amdfwtool/data_parse.c