Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • NetworkManager NetworkManager
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 194
    • Issues 194
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 23
    • Merge requests 23
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • NetworkManagerNetworkManager
  • NetworkManagerNetworkManager
  • Merge requests
  • !515

platform: fix binary search

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Matthias Schiffer requested to merge NeoRaider/NetworkManager:fix-binary-search into master May 23, 2020
  • Overview 2
  • Commits 1
  • Pipelines 2
  • Changes 1

When searching an element that is lower than the first list element (for example RTNL type "batadv"), imax will be -1 after the last iteration.

Use int instead of unsigned to make the termination condition imin > imax work in this case. This fixes NetworkManager crashing due to an out-of-bounds array access whenever interfaces of such types exist.

Fixes: 19ad0443 ('platform: use binary search to lookup NMLinkType for rtnl_type')

Edited May 23, 2020 by Matthias Schiffer
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-binary-search