FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

smbios: terminate ParseInfo loop on TableTypeEndOfTable by pstrinkle · Pull Request #3769 · u-root/u-root · GitHub

/ u-root Public

smbios: terminate ParseInfo loop on TableTypeEndOfTable - #3769

Open
pstrinkle wants to merge 2 commits into
u-root:mainfrom
pstrinkle:pstrinkle-patch-1
Open

pstrinkle wants to merge 2 commits into
u-root:mainfrom
pstrinkle:pstrinkle-patch-1

Conversation

Copy link
Copy Markdown

In SMBIOS 3.0+ (64-bit entry point), table data is sized using StructMaxSize, leaving trailing buffer padding after TableTypeEndOfTable (Type 127). ParseInfo previously ignored errEndOfTable and continued parsing remainder bytes, leading to io.ErrUnexpectedEOF.

Terminate the loop upon encountering errEndOfTable while appending the record.

In SMBIOS 3.0+ (64-bit entry point), table data is sized using StructMaxSize,
leaving trailing buffer padding after TableTypeEndOfTable (Type 127). ParseInfo
previously ignored errEndOfTable and continued parsing remainder bytes, leading
to io.ErrUnexpectedEOF.

Terminate the loop upon encountering errEndOfTable while appending the record.

Signed-off-by: Patrick Venture <venture@google.com>

codecov Bot commented Sep 30, 2026 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.31%. Comparing base (8c86aab) to head (19b6836).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3769      +/-   ##
==========================================
- Coverage   61.46%   61.31%   -0.15%     
==========================================
  Files         648      648              
  Lines       45716    45719       +3     
==========================================
- Hits        28099    28033      -66     
- Misses      17617    17686      +69     
Flag Coverage Δ
.-amd64 90.90% <ø> (ø)
cmds/...-amd64 52.38% <ø> (-0.02%) ⬇️
integration/generic-tests/...-amd64 29.35% <0.00%> (-0.01%) ⬇️
integration/generic-tests/...-arm 31.75% <ø> (ø)
integration/generic-tests/...-arm64 28.08% <0.00%> (-0.01%) ⬇️
integration/gotests/...-amd64 60.32% <ø> (-0.23%) ⬇️
integration/gotests/...-arm 60.58% <ø> (+<0.01%) ⬆️
integration/gotests/...-arm64 60.76% <ø> (-0.01%) ⬇️
pkg/...-amd64 59.10% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
everything 66.24% <100.00%> (-0.18%) ⬇️
cmds/exp 34.30% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Author

so the patch has my signature line. Not sure what's failing now...

rminnich requested a balanced review from Copilot October 1, 2026 23:42
rminnich added the Awaiting author Waiting for new changes or feedback for author. label Oct 1, 2026

rminnich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

thanks. So, Patrick, first time here? Nice to see you here.

rminnich commented Oct 1, 2026

Copy link
Copy Markdown
Member

I set dco to pass. I don't see the issue either.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot review overview

🟡 Changes recommended

The padded StructMaxSize behavior needs a targeted regression test.

Review effort: Balanced
Findings: 1

Open (1) What changed in this PR

Updates SMBIOS parsing to stop cleanly at the Type 127 end marker while preserving that record.

Changes:

  • Stops parsing trailing SMBIOS 3.x padding.
  • Retains the end-of-table record.
File Description
pkg/​smbios/​info.go Handles errEndOfTable as successful termination.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/smbios/info.go
Comment on lines +37 to +39
if err == errEndOfTable {
info.Tables = append(info.Tables, t)
break

rminnich commented Oct 2, 2026

Copy link
Copy Markdown
Member

how do you feel about letting copilot write the regression test for this change?

Copy link
Copy Markdown
Author

how do you feel about letting copilot write the regression test for this change?

Sure, I don't see a button to engage it. Please advise.

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting author Waiting for new changes or feedback for author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL