This patch set improves edge case testing:
* The parser is now more strict about checking boundary conditions when
parsing fields: an invalid field length is a possibility which is
now being accounted for;
* The parser will now make sure that RV and RW fields are the last
in their section by making sure that no more data is left to read
after those;
* RW field presence was already checked for but there was no test case
for it. This was prompted by a real-world hardware example where this
field was not present.
Invalid field values are now skipped instead of halting further parsing
completely. It turns out that some vendors use values like "N/A" if
fields were not populated in VPD-R and 0xFF as placeholders in VPD-W.
While this data is not valid, other data might be and it should be
possible to retrieve it.
Dmitrii Shcherbakov (4):
PCI VPD: handle additional edge cases
PCI VPD: Add a test case for the absence of RW
PCI VPD: Skip fields with invalid values
PCI VPD: Fix a wrong return code in a test case
src/util/virpcivpd.c | 37 ++++++--
tests/virpcivpdtest.c | 207 ++++++++++++++++++++++++++++++++++++++++--
2 files changed, 225 insertions(+), 19 deletions(-)
--
2.32.0