Skip to content

fix(addressbook): validate address entrie to prevent nil dereference#5534

Open
akrem-chabchoub wants to merge 2 commits into
masterfrom
fix/nil-bzz-addr
Open

fix(addressbook): validate address entrie to prevent nil dereference#5534
akrem-chabchoub wants to merge 2 commits into
masterfrom
fix/nil-bzz-addr

Conversation

@akrem-chabchoub

@akrem-chabchoub akrem-chabchoub commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Nodes crash with panic error when connecting to peers if the addressbook contains corrupted entries with nil Address fields.
Added nil check for address before returning it

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@akrem-chabchoub akrem-chabchoub self-assigned this Jul 10, 2026
@akrem-chabchoub akrem-chabchoub added this to the 2026 milestone Jul 10, 2026
return nil, false, err
}
if v.Address == nil {
return nil, false, ErrNotFound

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how about cleaning up the record while you're at it?
this returns "address not found", but leaves the db record corrupt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants